<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>pyprocessing.shapes</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="pyprocessing-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="pyprocessing-module.html">Package&nbsp;pyprocessing</a> ::
        Module&nbsp;shapes
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="pyprocessing.shapes-pysrc.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<h1 class="epydoc">Source Code for <a href="pyprocessing.shapes-module.html">Module pyprocessing.shapes</a></h1>
<pre class="py-src">
<a name="L1"></a><tt class="py-lineno">  1</tt>  <tt class="py-line"><tt class="py-comment">#coding: utf-8</tt> </tt>
<a name="L2"></a><tt class="py-lineno">  2</tt>  <tt class="py-line"><tt class="py-comment"></tt> </tt>
<a name="L3"></a><tt class="py-lineno">  3</tt>  <tt class="py-line"><tt class="py-comment">#************************</tt> </tt>
<a name="L4"></a><tt class="py-lineno">  4</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#  SHAPE STUFF </tt> </tt>
<a name="L5"></a><tt class="py-lineno">  5</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#************************</tt> </tt>
<a name="L6"></a><tt class="py-lineno">  6</tt>  <tt class="py-line"><tt class="py-comment"></tt> </tt>
<a name="L7"></a><tt class="py-lineno">  7</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">ctypes</tt> </tt>
<a name="L8"></a><tt class="py-lineno">  8</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-name">pyglet</tt><tt class="py-op">.</tt><tt class="py-name">gl</tt> <tt class="py-keyword">import</tt> <tt class="py-op">*</tt> </tt>
<a name="L9"></a><tt class="py-lineno">  9</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-0" class="py-name" targets="Module pyprocessing.globs=pyprocessing.globs-module.html"><a title="pyprocessing.globs" class="py-name" href="#" onclick="return doclink('link-0', 'globs', 'link-0');">globs</a></tt> <tt class="py-keyword">import</tt> <tt class="py-op">*</tt> </tt>
<a name="L10"></a><tt class="py-lineno"> 10</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-1" class="py-name" targets="Module pyprocessing.constants=pyprocessing.constants-module.html"><a title="pyprocessing.constants" class="py-name" href="#" onclick="return doclink('link-1', 'constants', 'link-1');">constants</a></tt> <tt class="py-keyword">import</tt> <tt class="py-op">*</tt> </tt>
<a name="L11"></a><tt class="py-lineno"> 11</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-2" class="py-name" targets="Module pyprocessing.pvector=pyprocessing.pvector-module.html"><a title="pyprocessing.pvector" class="py-name" href="#" onclick="return doclink('link-2', 'pvector', 'link-2');">pvector</a></tt> <tt class="py-keyword">import</tt> <tt class="py-op">*</tt> </tt>
<a name="L12"></a><tt class="py-lineno"> 12</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-3" class="py-name" targets="Module pyprocessing.primitives=pyprocessing.primitives-module.html"><a title="pyprocessing.primitives" class="py-name" href="#" onclick="return doclink('link-3', 'primitives', 'link-3');">primitives</a></tt> <tt class="py-keyword">import</tt> <tt id="link-4" class="py-name" targets="Function pyprocessing.primitives._smoothFixHackBegin()=pyprocessing.primitives-module.html#_smoothFixHackBegin"><a title="pyprocessing.primitives._smoothFixHackBegin" class="py-name" href="#" onclick="return doclink('link-4', '_smoothFixHackBegin', 'link-4');">_smoothFixHackBegin</a></tt><tt class="py-op">,</tt><tt id="link-5" class="py-name" targets="Function pyprocessing.primitives._smoothFixHackEnd()=pyprocessing.primitives-module.html#_smoothFixHackEnd"><a title="pyprocessing.primitives._smoothFixHackEnd" class="py-name" href="#" onclick="return doclink('link-5', '_smoothFixHackEnd', 'link-5');">_smoothFixHackEnd</a></tt> </tt>
<a name="L13"></a><tt class="py-lineno"> 13</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-name">math</tt> <tt class="py-keyword">import</tt> <tt class="py-op">*</tt> </tt>
<a name="L14"></a><tt class="py-lineno"> 14</tt>  <tt class="py-line"> </tt>
<a name="L15"></a><tt class="py-lineno"> 15</tt>  <tt class="py-line"><tt class="py-name">__all__</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-string">'beginShape'</tt><tt class="py-op">,</tt> <tt class="py-string">'vertex'</tt><tt class="py-op">,</tt> <tt class="py-string">'normal'</tt><tt class="py-op">,</tt> <tt class="py-string">'bezierVertex'</tt><tt class="py-op">,</tt> <tt class="py-string">'endShape'</tt><tt class="py-op">,</tt> </tt>
<a name="L16"></a><tt class="py-lineno"> 16</tt>  <tt class="py-line">         <tt class="py-string">'bezierDetail'</tt><tt class="py-op">,</tt> <tt class="py-string">'bezierPoint'</tt><tt class="py-op">,</tt> <tt class="py-string">'bezierTangent'</tt><tt class="py-op">,</tt> <tt class="py-string">'bezierSample'</tt><tt class="py-op">,</tt> </tt>
<a name="L17"></a><tt class="py-lineno"> 17</tt>  <tt class="py-line">         <tt class="py-string">'bezier'</tt><tt class="py-op">,</tt> <tt class="py-string">'curveTightness'</tt><tt class="py-op">,</tt> <tt class="py-string">'curve'</tt><tt class="py-op">,</tt> <tt class="py-string">'curveVertex'</tt><tt class="py-op">,</tt> <tt class="py-string">'curvePoint'</tt><tt class="py-op">,</tt> <tt class="py-string">'curveDetail'</tt><tt class="py-op">,</tt> </tt>
<a name="L18"></a><tt class="py-lineno"> 18</tt>  <tt class="py-line">         <tt class="py-string">'curveTangent'</tt><tt class="py-op">,</tt><tt class="py-string">'sphereDetail'</tt><tt class="py-op">]</tt> </tt>
<a name="L19"></a><tt class="py-lineno"> 19</tt>  <tt class="py-line">          </tt>
<a name="beginShape"></a><div id="beginShape-def"><a name="L20"></a><tt class="py-lineno"> 20</tt> <a class="py-toggle" href="#" id="beginShape-toggle" onclick="return toggle('beginShape');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pyprocessing.shapes-module.html#beginShape">beginShape</a><tt class="py-op">(</tt><tt class="py-param">type</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="beginShape-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="beginShape-expanded"><a name="L21"></a><tt class="py-lineno"> 21</tt>  <tt class="py-line">    <tt class="py-docstring">"""Begins the drawing of a shape."""</tt> </tt>
<a name="L22"></a><tt class="py-lineno"> 22</tt>  <tt class="py-line">    <tt id="link-6" class="py-name" targets="Class pyprocessing.globs.shape=pyprocessing.globs.shape-class.html"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-6', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-7" class="py-name" targets="Variable pyprocessing.globs.shape.type=pyprocessing.globs.shape-class.html#type"><a title="pyprocessing.globs.shape.type" class="py-name" href="#" onclick="return doclink('link-7', 'type', 'link-7');">type</a></tt> <tt class="py-op">=</tt> <tt id="link-8" class="py-name"><a title="pyprocessing.globs.shape.type" class="py-name" href="#" onclick="return doclink('link-8', 'type', 'link-7');">type</a></tt> </tt>
<a name="L23"></a><tt class="py-lineno"> 23</tt>  <tt class="py-line">    <tt id="link-9" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-9', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-10" class="py-name" targets="Variable pyprocessing.globs.shape.vtx=pyprocessing.globs.shape-class.html#vtx"><a title="pyprocessing.globs.shape.vtx" class="py-name" href="#" onclick="return doclink('link-10', 'vtx', 'link-10');">vtx</a></tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt>  <tt class="py-comment"># vertices drawn with vertex or sampled by curveVertex</tt> </tt>
<a name="L24"></a><tt class="py-lineno"> 24</tt>  <tt class="py-line">    <tt id="link-11" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-11', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt class="py-name">bez</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt>  <tt class="py-comment"># bezier vertices drawn with bezierVertex</tt> </tt>
<a name="L25"></a><tt class="py-lineno"> 25</tt>  <tt class="py-line">    <tt id="link-12" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-12', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt class="py-name">crv</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt>  <tt class="py-comment"># contents of the last three curveVertex calls</tt> </tt>
<a name="L26"></a><tt class="py-lineno"> 26</tt>  <tt class="py-line">    <tt id="link-13" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-13', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-14" class="py-name" targets="Variable pyprocessing.globs.shape.nrm=pyprocessing.globs.shape-class.html#nrm"><a title="pyprocessing.globs.shape.nrm" class="py-name" href="#" onclick="return doclink('link-14', 'nrm', 'link-14');">nrm</a></tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt>  <tt class="py-comment"># pairs (vtxindex,normal) </tt> </tt>
</div><a name="L27"></a><tt class="py-lineno"> 27</tt>  <tt class="py-line"> </tt>
<a name="vertex"></a><div id="vertex-def"><a name="L28"></a><tt class="py-lineno"> 28</tt> <a class="py-toggle" href="#" id="vertex-toggle" onclick="return toggle('vertex');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pyprocessing.shapes-module.html#vertex">vertex</a><tt class="py-op">(</tt><tt class="py-param">x</tt><tt class="py-op">,</tt><tt class="py-param">y</tt><tt class="py-op">,</tt><tt class="py-param">z</tt><tt class="py-op">=</tt><tt class="py-number">0.0</tt><tt class="py-op">,</tt><tt class="py-param">u</tt><tt class="py-op">=</tt><tt class="py-number">0.0</tt><tt class="py-op">,</tt><tt class="py-param">v</tt><tt class="py-op">=</tt><tt class="py-number">0.0</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="vertex-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="vertex-expanded"><a name="L29"></a><tt class="py-lineno"> 29</tt>  <tt class="py-line">    <tt class="py-docstring">"""Adds a new vertex to the shape"""</tt> </tt>
<a name="L30"></a><tt class="py-lineno"> 30</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt id="link-15" class="py-name" targets="Class pyprocessing.globs.attrib=pyprocessing.globs.attrib-class.html"><a title="pyprocessing.globs.attrib" class="py-name" href="#" onclick="return doclink('link-15', 'attrib', 'link-15');">attrib</a></tt><tt class="py-op">.</tt><tt id="link-16" class="py-name" targets="Function pyprocessing.attribs.texture()=pyprocessing.attribs-module.html#texture,Variable pyprocessing.globs.attrib.texture=pyprocessing.globs.attrib-class.html#texture"><a title="pyprocessing.attribs.texture
pyprocessing.globs.attrib.texture" class="py-name" href="#" onclick="return doclink('link-16', 'texture', 'link-16');">texture</a></tt><tt class="py-op">:</tt> <tt id="link-17" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-17', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-18" class="py-name"><a title="pyprocessing.globs.shape.vtx" class="py-name" href="#" onclick="return doclink('link-18', 'vtx', 'link-10');">vtx</a></tt> <tt class="py-op">+=</tt> <tt class="py-op">[</tt><tt class="py-op">(</tt><tt id="link-19" class="py-name" targets="Variable pyprocessing.globs.mouse.x=pyprocessing.globs.mouse-class.html#x,Variable pyprocessing.globs.pmouse.x=pyprocessing.globs.pmouse-class.html#x,Variable pyprocessing.pvector.PVector.x=pyprocessing.pvector.PVector-class.html#x"><a title="pyprocessing.globs.mouse.x
pyprocessing.globs.pmouse.x
pyprocessing.pvector.PVector.x" class="py-name" href="#" onclick="return doclink('link-19', 'x', 'link-19');">x</a></tt><tt class="py-op">,</tt><tt id="link-20" class="py-name" targets="Variable pyprocessing.globs.mouse.y=pyprocessing.globs.mouse-class.html#y,Variable pyprocessing.globs.pmouse.y=pyprocessing.globs.pmouse-class.html#y,Variable pyprocessing.pvector.PVector.y=pyprocessing.pvector.PVector-class.html#y"><a title="pyprocessing.globs.mouse.y
pyprocessing.globs.pmouse.y
pyprocessing.pvector.PVector.y" class="py-name" href="#" onclick="return doclink('link-20', 'y', 'link-20');">y</a></tt><tt class="py-op">,</tt><tt id="link-21" class="py-name" targets="Variable pyprocessing.pvector.PVector.z=pyprocessing.pvector.PVector-class.html#z"><a title="pyprocessing.pvector.PVector.z" class="py-name" href="#" onclick="return doclink('link-21', 'z', 'link-21');">z</a></tt><tt class="py-op">,</tt><tt class="py-name">u</tt><tt class="py-op">,</tt><tt class="py-name">v</tt><tt class="py-op">)</tt><tt class="py-op">]</tt> </tt>
<a name="L31"></a><tt class="py-lineno"> 31</tt>  <tt class="py-line">    <tt class="py-keyword">else</tt><tt class="py-op">:</tt> <tt id="link-22" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-22', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-23" class="py-name"><a title="pyprocessing.globs.shape.vtx" class="py-name" href="#" onclick="return doclink('link-23', 'vtx', 'link-10');">vtx</a></tt> <tt class="py-op">+=</tt> <tt class="py-op">[</tt><tt class="py-op">(</tt><tt id="link-24" class="py-name"><a title="pyprocessing.globs.mouse.x
pyprocessing.globs.pmouse.x
pyprocessing.pvector.PVector.x" class="py-name" href="#" onclick="return doclink('link-24', 'x', 'link-19');">x</a></tt><tt class="py-op">,</tt><tt id="link-25" class="py-name"><a title="pyprocessing.globs.mouse.y
pyprocessing.globs.pmouse.y
pyprocessing.pvector.PVector.y" class="py-name" href="#" onclick="return doclink('link-25', 'y', 'link-20');">y</a></tt><tt class="py-op">,</tt><tt id="link-26" class="py-name"><a title="pyprocessing.pvector.PVector.z" class="py-name" href="#" onclick="return doclink('link-26', 'z', 'link-21');">z</a></tt><tt class="py-op">)</tt><tt class="py-op">]</tt> </tt>
</div><a name="L32"></a><tt class="py-lineno"> 32</tt>  <tt class="py-line"> </tt>
<a name="normal"></a><div id="normal-def"><a name="L33"></a><tt class="py-lineno"> 33</tt> <a class="py-toggle" href="#" id="normal-toggle" onclick="return toggle('normal');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pyprocessing.shapes-module.html#normal">normal</a><tt class="py-op">(</tt><tt class="py-param">x</tt><tt class="py-op">,</tt><tt class="py-param">y</tt><tt class="py-op">,</tt><tt class="py-param">z</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="normal-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="normal-expanded"><a name="L34"></a><tt class="py-lineno"> 34</tt>  <tt class="py-line">    <tt class="py-docstring">"""Sets the next vertex's normal"""</tt> </tt>
<a name="L35"></a><tt class="py-lineno"> 35</tt>  <tt class="py-line">    <tt id="link-27" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-27', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-28" class="py-name"><a title="pyprocessing.globs.shape.nrm" class="py-name" href="#" onclick="return doclink('link-28', 'nrm', 'link-14');">nrm</a></tt> <tt class="py-op">+=</tt> <tt class="py-op">[</tt><tt class="py-op">(</tt><tt class="py-name">len</tt><tt class="py-op">(</tt><tt id="link-29" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-29', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-30" class="py-name"><a title="pyprocessing.globs.shape.vtx" class="py-name" href="#" onclick="return doclink('link-30', 'vtx', 'link-10');">vtx</a></tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-op">(</tt><tt id="link-31" class="py-name"><a title="pyprocessing.globs.mouse.x
pyprocessing.globs.pmouse.x
pyprocessing.pvector.PVector.x" class="py-name" href="#" onclick="return doclink('link-31', 'x', 'link-19');">x</a></tt><tt class="py-op">,</tt><tt id="link-32" class="py-name"><a title="pyprocessing.globs.mouse.y
pyprocessing.globs.pmouse.y
pyprocessing.pvector.PVector.y" class="py-name" href="#" onclick="return doclink('link-32', 'y', 'link-20');">y</a></tt><tt class="py-op">,</tt><tt id="link-33" class="py-name"><a title="pyprocessing.pvector.PVector.z" class="py-name" href="#" onclick="return doclink('link-33', 'z', 'link-21');">z</a></tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">]</tt> </tt>
</div><a name="L36"></a><tt class="py-lineno"> 36</tt>  <tt class="py-line">     </tt>
<a name="bezierVertex"></a><div id="bezierVertex-def"><a name="L37"></a><tt class="py-lineno"> 37</tt> <a class="py-toggle" href="#" id="bezierVertex-toggle" onclick="return toggle('bezierVertex');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pyprocessing.shapes-module.html#bezierVertex">bezierVertex</a><tt class="py-op">(</tt><tt class="py-op">*</tt><tt class="py-param">coords</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="bezierVertex-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="bezierVertex-expanded"><a name="L38"></a><tt class="py-lineno"> 38</tt>  <tt class="py-line">    <tt class="py-docstring">"""Generates a cubic bezier arc. Arguments are of the form</tt> </tt>
<a name="L39"></a><tt class="py-lineno"> 39</tt>  <tt class="py-line"><tt class="py-docstring">    (cx1, cy1, cx2, cy2, x, y) or</tt> </tt>
<a name="L40"></a><tt class="py-lineno"> 40</tt>  <tt class="py-line"><tt class="py-docstring">    (cx1, cy1, cz1, cx2, cy2, cz2, x, y, z), i.e. coordinates</tt> </tt>
<a name="L41"></a><tt class="py-lineno"> 41</tt>  <tt class="py-line"><tt class="py-docstring">    for 3 control points in 2D or 3D. The first control point of the</tt> </tt>
<a name="L42"></a><tt class="py-lineno"> 42</tt>  <tt class="py-line"><tt class="py-docstring">    arc is the last point of the previous arc or the last vertex.</tt> </tt>
<a name="L43"></a><tt class="py-lineno"> 43</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="L44"></a><tt class="py-lineno"> 44</tt>  <tt class="py-line">    <tt class="py-keyword">assert</tt> <tt class="py-op">(</tt><tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">coords</tt><tt class="py-op">)</tt> <tt class="py-keyword">in</tt> <tt class="py-op">(</tt><tt class="py-number">6</tt><tt class="py-op">,</tt><tt class="py-number">9</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L45"></a><tt class="py-lineno"> 45</tt>  <tt class="py-line">    <tt class="py-keyword">assert</tt> <tt class="py-op">(</tt><tt class="py-name">len</tt><tt class="py-op">(</tt><tt id="link-34" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-34', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-35" class="py-name"><a title="pyprocessing.globs.shape.vtx" class="py-name" href="#" onclick="return doclink('link-35', 'vtx', 'link-10');">vtx</a></tt><tt class="py-op">)</tt><tt class="py-op">&gt;</tt><tt class="py-number">0</tt><tt class="py-op">)</tt> </tt>
<a name="L46"></a><tt class="py-lineno"> 46</tt>  <tt class="py-line">    <tt class="py-comment"># remember the index where the bezier control points will be stored</tt> </tt>
<a name="L47"></a><tt class="py-lineno"> 47</tt>  <tt class="py-line"><tt class="py-comment"></tt>    <tt id="link-36" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-36', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt class="py-name">bez</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">len</tt><tt class="py-op">(</tt><tt id="link-37" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-37', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-38" class="py-name"><a title="pyprocessing.globs.shape.vtx" class="py-name" href="#" onclick="return doclink('link-38', 'vtx', 'link-10');">vtx</a></tt><tt class="py-op">)</tt><tt class="py-op">)</tt>  </tt>
<a name="L48"></a><tt class="py-lineno"> 48</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">coords</tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-number">6</tt><tt class="py-op">:</tt> </tt>
<a name="L49"></a><tt class="py-lineno"> 49</tt>  <tt class="py-line">        <tt id="link-39" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-39', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-40" class="py-name"><a title="pyprocessing.globs.shape.vtx" class="py-name" href="#" onclick="return doclink('link-40', 'vtx', 'link-10');">vtx</a></tt> <tt class="py-op">+=</tt> <tt class="py-op">[</tt><tt class="py-name">coords</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">+</tt><tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-name">coords</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">:</tt><tt class="py-number">4</tt><tt class="py-op">]</tt><tt class="py-op">+</tt><tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-name">coords</tt><tt class="py-op">[</tt><tt class="py-number">4</tt><tt class="py-op">:</tt><tt class="py-number">6</tt><tt class="py-op">]</tt><tt class="py-op">+</tt><tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-op">)</tt><tt class="py-op">]</tt> </tt>
<a name="L50"></a><tt class="py-lineno"> 50</tt>  <tt class="py-line">    <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L51"></a><tt class="py-lineno"> 51</tt>  <tt class="py-line">        <tt id="link-41" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-41', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-42" class="py-name"><a title="pyprocessing.globs.shape.vtx" class="py-name" href="#" onclick="return doclink('link-42', 'vtx', 'link-10');">vtx</a></tt> <tt class="py-op">+=</tt> <tt class="py-op">[</tt><tt class="py-name">coords</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-number">3</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">coords</tt><tt class="py-op">[</tt><tt class="py-number">3</tt><tt class="py-op">:</tt><tt class="py-number">6</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">coords</tt><tt class="py-op">[</tt><tt class="py-number">6</tt><tt class="py-op">:</tt><tt class="py-number">9</tt><tt class="py-op">]</tt><tt class="py-op">]</tt> </tt>
</div><a name="L52"></a><tt class="py-lineno"> 52</tt>  <tt class="py-line"> </tt>
<a name="endShape"></a><div id="endShape-def"><a name="L53"></a><tt class="py-lineno"> 53</tt> <a class="py-toggle" href="#" id="endShape-toggle" onclick="return toggle('endShape');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pyprocessing.shapes-module.html#endShape">endShape</a><tt class="py-op">(</tt><tt class="py-param">close</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="endShape-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="endShape-expanded"><a name="L54"></a><tt class="py-lineno"> 54</tt>  <tt class="py-line">    <tt class="py-docstring">"""Does the actual drawing of the shape."""</tt> </tt>
<a name="L55"></a><tt class="py-lineno"> 55</tt>  <tt class="py-line">     </tt>
<a name="L56"></a><tt class="py-lineno"> 56</tt>  <tt class="py-line">    <tt class="py-keyword">def</tt> <tt class="py-def-name">computeNormal</tt><tt class="py-op">(</tt><tt class="py-param">p0</tt><tt class="py-op">,</tt><tt class="py-param">p1</tt><tt class="py-op">,</tt><tt class="py-param">p2</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L57"></a><tt class="py-lineno"> 57</tt>  <tt class="py-line">        <tt class="py-docstring">"""Computes a normal for triangle p0-p1-p2."""</tt> </tt>
<a name="L58"></a><tt class="py-lineno"> 58</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-op">(</tt><tt id="link-43" class="py-name" targets="Class pyprocessing.pvector.PVector=pyprocessing.pvector.PVector-class.html"><a title="pyprocessing.pvector.PVector" class="py-name" href="#" onclick="return doclink('link-43', 'PVector', 'link-43');">PVector</a></tt><tt class="py-op">(</tt><tt class="py-name">p1</tt><tt class="py-op">)</tt><tt class="py-op">-</tt><tt id="link-44" class="py-name"><a title="pyprocessing.pvector.PVector" class="py-name" href="#" onclick="return doclink('link-44', 'PVector', 'link-43');">PVector</a></tt><tt class="py-op">(</tt><tt class="py-name">p0</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt id="link-45" class="py-name" targets="Method pyprocessing.pvector.PVector.cross()=pyprocessing.pvector.PVector-class.html#cross"><a title="pyprocessing.pvector.PVector.cross" class="py-name" href="#" onclick="return doclink('link-45', 'cross', 'link-45');">cross</a></tt><tt class="py-op">(</tt><tt id="link-46" class="py-name"><a title="pyprocessing.pvector.PVector" class="py-name" href="#" onclick="return doclink('link-46', 'PVector', 'link-43');">PVector</a></tt><tt class="py-op">(</tt><tt class="py-name">p2</tt><tt class="py-op">)</tt><tt class="py-op">-</tt><tt id="link-47" class="py-name"><a title="pyprocessing.pvector.PVector" class="py-name" href="#" onclick="return doclink('link-47', 'PVector', 'link-43');">PVector</a></tt><tt class="py-op">(</tt><tt class="py-name">p1</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div><a name="L59"></a><tt class="py-lineno"> 59</tt>  <tt class="py-line">         </tt>
<a name="L60"></a><tt class="py-lineno"> 60</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt id="link-48" class="py-name"><a title="pyprocessing.globs.attrib" class="py-name" href="#" onclick="return doclink('link-48', 'attrib', 'link-15');">attrib</a></tt><tt class="py-op">.</tt><tt id="link-49" class="py-name"><a title="pyprocessing.attribs.texture
pyprocessing.globs.attrib.texture" class="py-name" href="#" onclick="return doclink('link-49', 'texture', 'link-16');">texture</a></tt><tt class="py-op">:</tt> </tt>
<a name="L61"></a><tt class="py-lineno"> 61</tt>  <tt class="py-line">        <tt id="link-50" class="py-name" targets="Variable pyprocessing.lights'.glEnable=pyprocessing.lights%27-module.html#glEnable"><a title="pyprocessing.lights'.glEnable" class="py-name" href="#" onclick="return doclink('link-50', 'glEnable', 'link-50');">glEnable</a></tt><tt class="py-op">(</tt><tt id="link-51" class="py-name" targets="Variable pyprocessing.lights'.GL_TEXTURE_2D=pyprocessing.lights%27-module.html#GL_TEXTURE_2D"><a title="pyprocessing.lights'.GL_TEXTURE_2D" class="py-name" href="#" onclick="return doclink('link-51', 'GL_TEXTURE_2D', 'link-51');">GL_TEXTURE_2D</a></tt><tt class="py-op">)</tt> </tt>
<a name="L62"></a><tt class="py-lineno"> 62</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt id="link-52" class="py-name"><a title="pyprocessing.globs.shape.type" class="py-name" href="#" onclick="return doclink('link-52', 'type', 'link-7');">type</a></tt><tt class="py-op">(</tt><tt id="link-53" class="py-name"><a title="pyprocessing.globs.attrib" class="py-name" href="#" onclick="return doclink('link-53', 'attrib', 'link-15');">attrib</a></tt><tt class="py-op">.</tt><tt id="link-54" class="py-name"><a title="pyprocessing.attribs.texture
pyprocessing.globs.attrib.texture" class="py-name" href="#" onclick="return doclink('link-54', 'texture', 'link-16');">texture</a></tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-name">str</tt><tt class="py-op">:</tt> </tt>
<a name="L63"></a><tt class="py-lineno"> 63</tt>  <tt class="py-line">            <tt id="link-55" class="py-name" targets="Function pyprocessing.pimage.image()=pyprocessing.pimage-module.html#image"><a title="pyprocessing.pimage.image" class="py-name" href="#" onclick="return doclink('link-55', 'image', 'link-55');">image</a></tt> <tt class="py-op">=</tt> <tt class="py-name">pyglet</tt><tt class="py-op">.</tt><tt id="link-56" class="py-name"><a title="pyprocessing.pimage.image" class="py-name" href="#" onclick="return doclink('link-56', 'image', 'link-55');">image</a></tt><tt class="py-op">.</tt><tt class="py-name">load</tt><tt class="py-op">(</tt><tt id="link-57" class="py-name"><a title="pyprocessing.globs.attrib" class="py-name" href="#" onclick="return doclink('link-57', 'attrib', 'link-15');">attrib</a></tt><tt class="py-op">.</tt><tt id="link-58" class="py-name"><a title="pyprocessing.attribs.texture
pyprocessing.globs.attrib.texture" class="py-name" href="#" onclick="return doclink('link-58', 'texture', 'link-16');">texture</a></tt><tt class="py-op">)</tt> </tt>
<a name="L64"></a><tt class="py-lineno"> 64</tt>  <tt class="py-line">            <tt id="link-59" class="py-name"><a title="pyprocessing.attribs.texture
pyprocessing.globs.attrib.texture" class="py-name" href="#" onclick="return doclink('link-59', 'texture', 'link-16');">texture</a></tt> <tt class="py-op">=</tt> <tt id="link-60" class="py-name"><a title="pyprocessing.pimage.image" class="py-name" href="#" onclick="return doclink('link-60', 'image', 'link-55');">image</a></tt><tt class="py-op">.</tt><tt class="py-name">get_texture</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L65"></a><tt class="py-lineno"> 65</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L66"></a><tt class="py-lineno"> 66</tt>  <tt class="py-line">            <tt id="link-61" class="py-name"><a title="pyprocessing.attribs.texture
pyprocessing.globs.attrib.texture" class="py-name" href="#" onclick="return doclink('link-61', 'texture', 'link-16');">texture</a></tt> <tt class="py-op">=</tt> <tt id="link-62" class="py-name"><a title="pyprocessing.globs.attrib" class="py-name" href="#" onclick="return doclink('link-62', 'attrib', 'link-15');">attrib</a></tt><tt class="py-op">.</tt><tt id="link-63" class="py-name"><a title="pyprocessing.attribs.texture
pyprocessing.globs.attrib.texture" class="py-name" href="#" onclick="return doclink('link-63', 'texture', 'link-16');">texture</a></tt><tt class="py-op">.</tt><tt id="link-64" class="py-name" targets="Variable pyprocessing.pimage.PImage.img=pyprocessing.pimage.PImage-class.html#img"><a title="pyprocessing.pimage.PImage.img" class="py-name" href="#" onclick="return doclink('link-64', 'img', 'link-64');">img</a></tt><tt class="py-op">.</tt><tt class="py-name">get_texture</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L67"></a><tt class="py-lineno"> 67</tt>  <tt class="py-line">        <tt class="py-name">t</tt> <tt class="py-op">=</tt> <tt id="link-65" class="py-name"><a title="pyprocessing.attribs.texture
pyprocessing.globs.attrib.texture" class="py-name" href="#" onclick="return doclink('link-65', 'texture', 'link-16');">texture</a></tt><tt class="py-op">.</tt><tt class="py-name">tex_coords</tt> </tt>
<a name="L68"></a><tt class="py-lineno"> 68</tt>  <tt class="py-line">        <tt id="link-66" class="py-name" targets="Variable pyprocessing.lights'.glBindTexture=pyprocessing.lights%27-module.html#glBindTexture"><a title="pyprocessing.lights'.glBindTexture" class="py-name" href="#" onclick="return doclink('link-66', 'glBindTexture', 'link-66');">glBindTexture</a></tt><tt class="py-op">(</tt><tt id="link-67" class="py-name"><a title="pyprocessing.lights'.GL_TEXTURE_2D" class="py-name" href="#" onclick="return doclink('link-67', 'GL_TEXTURE_2D', 'link-51');">GL_TEXTURE_2D</a></tt><tt class="py-op">,</tt><tt id="link-68" class="py-name"><a title="pyprocessing.attribs.texture
pyprocessing.globs.attrib.texture" class="py-name" href="#" onclick="return doclink('link-68', 'texture', 'link-16');">texture</a></tt><tt class="py-op">.</tt><tt class="py-name">id</tt><tt class="py-op">)</tt> </tt>
<a name="L69"></a><tt class="py-lineno"> 69</tt>  <tt class="py-line">        <tt id="link-69" class="py-name" targets="Variable pyprocessing.lights'.glTexParameteri=pyprocessing.lights%27-module.html#glTexParameteri"><a title="pyprocessing.lights'.glTexParameteri" class="py-name" href="#" onclick="return doclink('link-69', 'glTexParameteri', 'link-69');">glTexParameteri</a></tt><tt class="py-op">(</tt><tt id="link-70" class="py-name"><a title="pyprocessing.lights'.GL_TEXTURE_2D" class="py-name" href="#" onclick="return doclink('link-70', 'GL_TEXTURE_2D', 'link-51');">GL_TEXTURE_2D</a></tt><tt class="py-op">,</tt><tt id="link-71" class="py-name" targets="Variable pyprocessing.lights'.GL_TEXTURE_MAG_FILTER=pyprocessing.lights%27-module.html#GL_TEXTURE_MAG_FILTER"><a title="pyprocessing.lights'.GL_TEXTURE_MAG_FILTER" class="py-name" href="#" onclick="return doclink('link-71', 'GL_TEXTURE_MAG_FILTER', 'link-71');">GL_TEXTURE_MAG_FILTER</a></tt><tt class="py-op">,</tt><tt id="link-72" class="py-name" targets="Variable pyprocessing.lights'.GL_LINEAR=pyprocessing.lights%27-module.html#GL_LINEAR"><a title="pyprocessing.lights'.GL_LINEAR" class="py-name" href="#" onclick="return doclink('link-72', 'GL_LINEAR', 'link-72');">GL_LINEAR</a></tt><tt class="py-op">)</tt> </tt>
<a name="L70"></a><tt class="py-lineno"> 70</tt>  <tt class="py-line">        <tt id="link-73" class="py-name" targets="Variable pyprocessing.lights'.glMatrixMode=pyprocessing.lights%27-module.html#glMatrixMode"><a title="pyprocessing.lights'.glMatrixMode" class="py-name" href="#" onclick="return doclink('link-73', 'glMatrixMode', 'link-73');">glMatrixMode</a></tt><tt class="py-op">(</tt><tt id="link-74" class="py-name" targets="Variable pyprocessing.lights'.GL_TEXTURE=pyprocessing.lights%27-module.html#GL_TEXTURE"><a title="pyprocessing.lights'.GL_TEXTURE" class="py-name" href="#" onclick="return doclink('link-74', 'GL_TEXTURE', 'link-74');">GL_TEXTURE</a></tt><tt class="py-op">)</tt><tt class="py-op">;</tt> </tt>
<a name="L71"></a><tt class="py-lineno"> 71</tt>  <tt class="py-line">        <tt id="link-75" class="py-name" targets="Variable pyprocessing.lights'.glLoadIdentity=pyprocessing.lights%27-module.html#glLoadIdentity"><a title="pyprocessing.lights'.glLoadIdentity" class="py-name" href="#" onclick="return doclink('link-75', 'glLoadIdentity', 'link-75');">glLoadIdentity</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">;</tt> </tt>
<a name="L72"></a><tt class="py-lineno"> 72</tt>  <tt class="py-line">        <tt id="link-76" class="py-name" targets="Variable pyprocessing.lights'.glTranslatef=pyprocessing.lights%27-module.html#glTranslatef"><a title="pyprocessing.lights'.glTranslatef" class="py-name" href="#" onclick="return doclink('link-76', 'glTranslatef', 'link-76');">glTranslatef</a></tt><tt class="py-op">(</tt><tt class="py-number">0.0</tt><tt class="py-op">,</tt><tt class="py-name">t</tt><tt class="py-op">[</tt><tt class="py-number">7</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-number">0.0</tt><tt class="py-op">)</tt><tt class="py-op">;</tt> </tt>
<a name="L73"></a><tt class="py-lineno"> 73</tt>  <tt class="py-line">        <tt id="link-77" class="py-name"><a title="pyprocessing.lights'.glMatrixMode" class="py-name" href="#" onclick="return doclink('link-77', 'glMatrixMode', 'link-73');">glMatrixMode</a></tt><tt class="py-op">(</tt><tt id="link-78" class="py-name" targets="Variable pyprocessing.lights'.GL_MODELVIEW=pyprocessing.lights%27-module.html#GL_MODELVIEW"><a title="pyprocessing.lights'.GL_MODELVIEW" class="py-name" href="#" onclick="return doclink('link-78', 'GL_MODELVIEW', 'link-78');">GL_MODELVIEW</a></tt><tt class="py-op">)</tt><tt class="py-op">;</tt> </tt>
<a name="L74"></a><tt class="py-lineno"> 74</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt id="link-79" class="py-name"><a title="pyprocessing.globs.attrib" class="py-name" href="#" onclick="return doclink('link-79', 'attrib', 'link-15');">attrib</a></tt><tt class="py-op">.</tt><tt id="link-80" class="py-name" targets="Function pyprocessing.attribs.textureMode()=pyprocessing.attribs-module.html#textureMode,Variable pyprocessing.globs.attrib.textureMode=pyprocessing.globs.attrib-class.html#textureMode"><a title="pyprocessing.attribs.textureMode
pyprocessing.globs.attrib.textureMode" class="py-name" href="#" onclick="return doclink('link-80', 'textureMode', 'link-80');">textureMode</a></tt> <tt class="py-op">==</tt> <tt id="link-81" class="py-name" targets="Variable pyprocessing.IMAGE=pyprocessing-module.html#IMAGE,Variable pyprocessing.attribs.IMAGE=pyprocessing.attribs-module.html#IMAGE,Variable pyprocessing.colors.IMAGE=pyprocessing.colors-module.html#IMAGE,Variable pyprocessing.config.IMAGE=pyprocessing.config-module.html#IMAGE,Variable pyprocessing.constants.IMAGE=pyprocessing.constants-module.html#IMAGE,Variable pyprocessing.fonts.IMAGE=pyprocessing.fonts-module.html#IMAGE,Variable pyprocessing.globs.IMAGE=pyprocessing.globs-module.html#IMAGE,Variable pyprocessing.lights'.IMAGE=pyprocessing.lights%27-module.html#IMAGE,Variable pyprocessing.materials.IMAGE=pyprocessing.materials-module.html#IMAGE,Variable pyprocessing.pimage.IMAGE=pyprocessing.pimage-module.html#IMAGE,Variable pyprocessing.primitives.IMAGE=pyprocessing.primitives-module.html#IMAGE,Variable pyprocessing.shapes.IMAGE=pyprocessing.shapes-module.html#IMAGE,Variable pyprocessing.transformations.IMAGE=pyprocessing.transformations-module.html#IMAGE"><a title="pyprocessing.IMAGE
pyprocessing.attribs.IMAGE
pyprocessing.colors.IMAGE
pyprocessing.config.IMAGE
pyprocessing.constants.IMAGE
pyprocessing.fonts.IMAGE
pyprocessing.globs.IMAGE
pyprocessing.lights'.IMAGE
pyprocessing.materials.IMAGE
pyprocessing.pimage.IMAGE
pyprocessing.primitives.IMAGE
pyprocessing.shapes.IMAGE
pyprocessing.transformations.IMAGE" class="py-name" href="#" onclick="return doclink('link-81', 'IMAGE', 'link-81');">IMAGE</a></tt><tt class="py-op">:</tt> </tt>
<a name="L75"></a><tt class="py-lineno"> 75</tt>  <tt class="py-line">            <tt class="py-name">normx</tt> <tt class="py-op">=</tt> <tt id="link-82" class="py-name"><a title="pyprocessing.pimage.image" class="py-name" href="#" onclick="return doclink('link-82', 'image', 'link-55');">image</a></tt><tt class="py-op">.</tt><tt id="link-83" class="py-name" targets="Variable pyprocessing.globs.screen.width=pyprocessing.globs.screen-class.html#width,Variable pyprocessing.pimage.PImage.width=pyprocessing.pimage.PImage-class.html#width"><a title="pyprocessing.globs.screen.width
pyprocessing.pimage.PImage.width" class="py-name" href="#" onclick="return doclink('link-83', 'width', 'link-83');">width</a></tt> </tt>
<a name="L76"></a><tt class="py-lineno"> 76</tt>  <tt class="py-line">            <tt class="py-name">normy</tt> <tt class="py-op">=</tt> <tt id="link-84" class="py-name"><a title="pyprocessing.pimage.image" class="py-name" href="#" onclick="return doclink('link-84', 'image', 'link-55');">image</a></tt><tt class="py-op">.</tt><tt id="link-85" class="py-name" targets="Variable pyprocessing.globs.screen.height=pyprocessing.globs.screen-class.html#height,Variable pyprocessing.pimage.PImage.height=pyprocessing.pimage.PImage-class.html#height"><a title="pyprocessing.globs.screen.height
pyprocessing.pimage.PImage.height" class="py-name" href="#" onclick="return doclink('link-85', 'height', 'link-85');">height</a></tt> </tt>
<a name="L77"></a><tt class="py-lineno"> 77</tt>  <tt class="py-line">        <tt class="py-keyword">elif</tt> <tt id="link-86" class="py-name"><a title="pyprocessing.globs.attrib" class="py-name" href="#" onclick="return doclink('link-86', 'attrib', 'link-15');">attrib</a></tt><tt class="py-op">.</tt><tt id="link-87" class="py-name"><a title="pyprocessing.attribs.textureMode
pyprocessing.globs.attrib.textureMode" class="py-name" href="#" onclick="return doclink('link-87', 'textureMode', 'link-80');">textureMode</a></tt> <tt class="py-op">==</tt> <tt id="link-88" class="py-name" targets="Variable pyprocessing.NORMALIZED=pyprocessing-module.html#NORMALIZED,Variable pyprocessing.attribs.NORMALIZED=pyprocessing.attribs-module.html#NORMALIZED,Variable pyprocessing.colors.NORMALIZED=pyprocessing.colors-module.html#NORMALIZED,Variable pyprocessing.config.NORMALIZED=pyprocessing.config-module.html#NORMALIZED,Variable pyprocessing.constants.NORMALIZED=pyprocessing.constants-module.html#NORMALIZED,Variable pyprocessing.fonts.NORMALIZED=pyprocessing.fonts-module.html#NORMALIZED,Variable pyprocessing.globs.NORMALIZED=pyprocessing.globs-module.html#NORMALIZED,Variable pyprocessing.lights'.NORMALIZED=pyprocessing.lights%27-module.html#NORMALIZED,Variable pyprocessing.materials.NORMALIZED=pyprocessing.materials-module.html#NORMALIZED,Variable pyprocessing.pimage.NORMALIZED=pyprocessing.pimage-module.html#NORMALIZED,Variable pyprocessing.primitives.NORMALIZED=pyprocessing.primitives-module.html#NORMALIZED,Variable pyprocessing.shapes.NORMALIZED=pyprocessing.shapes-module.html#NORMALIZED,Variable pyprocessing.transformations.NORMALIZED=pyprocessing.transformations-module.html#NORMALIZED"><a title="pyprocessing.NORMALIZED
pyprocessing.attribs.NORMALIZED
pyprocessing.colors.NORMALIZED
pyprocessing.config.NORMALIZED
pyprocessing.constants.NORMALIZED
pyprocessing.fonts.NORMALIZED
pyprocessing.globs.NORMALIZED
pyprocessing.lights'.NORMALIZED
pyprocessing.materials.NORMALIZED
pyprocessing.pimage.NORMALIZED
pyprocessing.primitives.NORMALIZED
pyprocessing.shapes.NORMALIZED
pyprocessing.transformations.NORMALIZED" class="py-name" href="#" onclick="return doclink('link-88', 'NORMALIZED', 'link-88');">NORMALIZED</a></tt><tt class="py-op">:</tt> </tt>
<a name="L78"></a><tt class="py-lineno"> 78</tt>  <tt class="py-line">            <tt class="py-name">normx</tt> <tt class="py-op">=</tt> <tt class="py-name">normy</tt> <tt class="py-op">=</tt> <tt class="py-number">1.0</tt> </tt>
<a name="L79"></a><tt class="py-lineno"> 79</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt id="link-89" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-89', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-90" class="py-name"><a title="pyprocessing.globs.shape.type" class="py-name" href="#" onclick="return doclink('link-90', 'type', 'link-7');">type</a></tt><tt class="py-op">:</tt> <tt id="link-91" class="py-name" targets="Variable pyprocessing.lights'.glBegin=pyprocessing.lights%27-module.html#glBegin"><a title="pyprocessing.lights'.glBegin" class="py-name" href="#" onclick="return doclink('link-91', 'glBegin', 'link-91');">glBegin</a></tt><tt class="py-op">(</tt><tt id="link-92" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-92', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-93" class="py-name"><a title="pyprocessing.globs.shape.type" class="py-name" href="#" onclick="return doclink('link-93', 'type', 'link-7');">type</a></tt><tt class="py-op">)</tt> </tt>
<a name="L80"></a><tt class="py-lineno"> 80</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> <tt id="link-94" class="py-name"><a title="pyprocessing.lights'.glBegin" class="py-name" href="#" onclick="return doclink('link-94', 'glBegin', 'link-91');">glBegin</a></tt><tt class="py-op">(</tt><tt id="link-95" class="py-name" targets="Variable pyprocessing.lights'.GL_POLYGON=pyprocessing.lights%27-module.html#GL_POLYGON"><a title="pyprocessing.lights'.GL_POLYGON" class="py-name" href="#" onclick="return doclink('link-95', 'GL_POLYGON', 'link-95');">GL_POLYGON</a></tt><tt class="py-op">)</tt> </tt>
<a name="L81"></a><tt class="py-lineno"> 81</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">v</tt> <tt class="py-keyword">in</tt> <tt id="link-96" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-96', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-97" class="py-name"><a title="pyprocessing.globs.shape.vtx" class="py-name" href="#" onclick="return doclink('link-97', 'vtx', 'link-10');">vtx</a></tt><tt class="py-op">:</tt> </tt>
<a name="L82"></a><tt class="py-lineno"> 82</tt>  <tt class="py-line">            <tt id="link-98" class="py-name" targets="Variable pyprocessing.lights'.glTexCoord2f=pyprocessing.lights%27-module.html#glTexCoord2f"><a title="pyprocessing.lights'.glTexCoord2f" class="py-name" href="#" onclick="return doclink('link-98', 'glTexCoord2f', 'link-98');">glTexCoord2f</a></tt><tt class="py-op">(</tt><tt class="py-name">v</tt><tt class="py-op">[</tt><tt class="py-number">3</tt><tt class="py-op">]</tt><tt class="py-op">*</tt><tt class="py-name">t</tt><tt class="py-op">[</tt><tt class="py-number">6</tt><tt class="py-op">]</tt><tt class="py-op">/</tt><tt class="py-name">normx</tt><tt class="py-op">,</tt><tt class="py-op">-</tt><tt class="py-name">v</tt><tt class="py-op">[</tt><tt class="py-number">4</tt><tt class="py-op">]</tt><tt class="py-op">*</tt><tt class="py-name">t</tt><tt class="py-op">[</tt><tt class="py-number">7</tt><tt class="py-op">]</tt><tt class="py-op">/</tt><tt class="py-name">normy</tt><tt class="py-op">)</tt> </tt>
<a name="L83"></a><tt class="py-lineno"> 83</tt>  <tt class="py-line">            <tt id="link-99" class="py-name" targets="Variable pyprocessing.lights'.glVertex3f=pyprocessing.lights%27-module.html#glVertex3f"><a title="pyprocessing.lights'.glVertex3f" class="py-name" href="#" onclick="return doclink('link-99', 'glVertex3f', 'link-99');">glVertex3f</a></tt><tt class="py-op">(</tt><tt class="py-op">*</tt><tt class="py-name">v</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-number">3</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L84"></a><tt class="py-lineno"> 84</tt>  <tt class="py-line">        <tt id="link-100" class="py-name" targets="Variable pyprocessing.lights'.glEnd=pyprocessing.lights%27-module.html#glEnd"><a title="pyprocessing.lights'.glEnd" class="py-name" href="#" onclick="return doclink('link-100', 'glEnd', 'link-100');">glEnd</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L85"></a><tt class="py-lineno"> 85</tt>  <tt class="py-line">        <tt id="link-101" class="py-name"><a title="pyprocessing.globs.attrib" class="py-name" href="#" onclick="return doclink('link-101', 'attrib', 'link-15');">attrib</a></tt><tt class="py-op">.</tt><tt id="link-102" class="py-name"><a title="pyprocessing.attribs.texture
pyprocessing.globs.attrib.texture" class="py-name" href="#" onclick="return doclink('link-102', 'texture', 'link-16');">texture</a></tt> <tt class="py-op">=</tt> <tt class="py-name">None</tt> </tt>
<a name="L86"></a><tt class="py-lineno"> 86</tt>  <tt class="py-line">    <tt class="py-comment"># Draw the interior of the shape    </tt> </tt>
<a name="L87"></a><tt class="py-lineno"> 87</tt>  <tt class="py-line"><tt class="py-comment"></tt>    <tt class="py-keyword">elif</tt> <tt id="link-103" class="py-name"><a title="pyprocessing.globs.attrib" class="py-name" href="#" onclick="return doclink('link-103', 'attrib', 'link-15');">attrib</a></tt><tt class="py-op">.</tt><tt id="link-104" class="py-name" targets="Variable pyprocessing.globs.attrib.fillColor=pyprocessing.globs.attrib-class.html#fillColor"><a title="pyprocessing.globs.attrib.fillColor" class="py-name" href="#" onclick="return doclink('link-104', 'fillColor', 'link-104');">fillColor</a></tt> <tt class="py-op">!=</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L88"></a><tt class="py-lineno"> 88</tt>  <tt class="py-line">        <tt id="link-105" class="py-name" targets="Variable pyprocessing.lights'.glColor4f=pyprocessing.lights%27-module.html#glColor4f"><a title="pyprocessing.lights'.glColor4f" class="py-name" href="#" onclick="return doclink('link-105', 'glColor4f', 'link-105');">glColor4f</a></tt><tt class="py-op">(</tt><tt class="py-op">*</tt><tt id="link-106" class="py-name"><a title="pyprocessing.globs.attrib" class="py-name" href="#" onclick="return doclink('link-106', 'attrib', 'link-15');">attrib</a></tt><tt class="py-op">.</tt><tt id="link-107" class="py-name"><a title="pyprocessing.globs.attrib.fillColor" class="py-name" href="#" onclick="return doclink('link-107', 'fillColor', 'link-104');">fillColor</a></tt><tt class="py-op">)</tt> </tt>
<a name="L89"></a><tt class="py-lineno"> 89</tt>  <tt class="py-line">        <tt class="py-comment"># establish an initial normal vector</tt> </tt>
<a name="L90"></a><tt class="py-lineno"> 90</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-keyword">if</tt> <tt id="link-108" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-108', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-109" class="py-name"><a title="pyprocessing.globs.shape.nrm" class="py-name" href="#" onclick="return doclink('link-109', 'nrm', 'link-14');">nrm</a></tt> <tt class="py-op">!=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">:</tt> </tt>
<a name="L91"></a><tt class="py-lineno"> 91</tt>  <tt class="py-line">            <tt class="py-name">inormal</tt><tt class="py-op">,</tt> <tt id="link-110" class="py-name" targets="Function pyprocessing.shapes.normal()=pyprocessing.shapes-module.html#normal"><a title="pyprocessing.shapes.normal" class="py-name" href="#" onclick="return doclink('link-110', 'normal', 'link-110');">normal</a></tt> <tt class="py-op">=</tt> <tt id="link-111" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-111', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-112" class="py-name"><a title="pyprocessing.globs.shape.nrm" class="py-name" href="#" onclick="return doclink('link-112', 'nrm', 'link-14');">nrm</a></tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> </tt>
<a name="L92"></a><tt class="py-lineno"> 92</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L93"></a><tt class="py-lineno"> 93</tt>  <tt class="py-line">            <tt class="py-name">inormal</tt> <tt class="py-op">=</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt id="link-113" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-113', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-114" class="py-name"><a title="pyprocessing.globs.shape.vtx" class="py-name" href="#" onclick="return doclink('link-114', 'vtx', 'link-10');">vtx</a></tt><tt class="py-op">)</tt> </tt>
<a name="L94"></a><tt class="py-lineno"> 94</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt id="link-115" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-115', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-116" class="py-name"><a title="pyprocessing.globs.shape.vtx" class="py-name" href="#" onclick="return doclink('link-116', 'vtx', 'link-10');">vtx</a></tt><tt class="py-op">)</tt><tt class="py-op">&gt;=</tt><tt class="py-number">3</tt><tt class="py-op">:</tt> </tt>
<a name="L95"></a><tt class="py-lineno"> 95</tt>  <tt class="py-line">                <tt id="link-117" class="py-name"><a title="pyprocessing.shapes.normal" class="py-name" href="#" onclick="return doclink('link-117', 'normal', 'link-110');">normal</a></tt> <tt class="py-op">=</tt> <tt class="py-name">computeNormal</tt><tt class="py-op">(</tt><tt id="link-118" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-118', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-119" class="py-name"><a title="pyprocessing.globs.shape.vtx" class="py-name" href="#" onclick="return doclink('link-119', 'vtx', 'link-10');">vtx</a></tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt id="link-120" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-120', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-121" class="py-name"><a title="pyprocessing.globs.shape.vtx" class="py-name" href="#" onclick="return doclink('link-121', 'vtx', 'link-10');">vtx</a></tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt id="link-122" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-122', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-123" class="py-name"><a title="pyprocessing.globs.shape.vtx" class="py-name" href="#" onclick="return doclink('link-123', 'vtx', 'link-10');">vtx</a></tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L96"></a><tt class="py-lineno"> 96</tt>  <tt class="py-line">            <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L97"></a><tt class="py-lineno"> 97</tt>  <tt class="py-line">                <tt id="link-124" class="py-name"><a title="pyprocessing.shapes.normal" class="py-name" href="#" onclick="return doclink('link-124', 'normal', 'link-110');">normal</a></tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-number">1</tt><tt class="py-op">]</tt> </tt>
<a name="L98"></a><tt class="py-lineno"> 98</tt>  <tt class="py-line">        <tt id="link-125" class="py-name" targets="Variable pyprocessing.lights'.glNormal3f=pyprocessing.lights%27-module.html#glNormal3f"><a title="pyprocessing.lights'.glNormal3f" class="py-name" href="#" onclick="return doclink('link-125', 'glNormal3f', 'link-125');">glNormal3f</a></tt><tt class="py-op">(</tt><tt class="py-op">*</tt><tt id="link-126" class="py-name"><a title="pyprocessing.shapes.normal" class="py-name" href="#" onclick="return doclink('link-126', 'normal', 'link-110');">normal</a></tt><tt class="py-op">)</tt> </tt>
<a name="L99"></a><tt class="py-lineno"> 99</tt>  <tt class="py-line">        <tt class="py-comment"># Draw filled shape</tt> </tt>
<a name="L100"></a><tt class="py-lineno">100</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-keyword">if</tt> <tt id="link-127" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-127', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-128" class="py-name"><a title="pyprocessing.globs.shape.type" class="py-name" href="#" onclick="return doclink('link-128', 'type', 'link-7');">type</a></tt><tt class="py-op">==</tt><tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L101"></a><tt class="py-lineno">101</tt>  <tt class="py-line">            <tt id="link-129" class="py-name"><a title="pyprocessing.primitives._smoothFixHackBegin" class="py-name" href="#" onclick="return doclink('link-129', '_smoothFixHackBegin', 'link-4');">_smoothFixHackBegin</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L102"></a><tt class="py-lineno">102</tt>  <tt class="py-line">            <tt class="py-comment"># first create a tesselator object if none was defined yet</tt> </tt>
<a name="L103"></a><tt class="py-lineno">103</tt>  <tt class="py-line"><tt class="py-comment"></tt>            <tt class="py-keyword">if</tt> <tt id="link-130" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-130', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-131" class="py-name" targets="Variable pyprocessing.globs.shape.tess=pyprocessing.globs.shape-class.html#tess"><a title="pyprocessing.globs.shape.tess" class="py-name" href="#" onclick="return doclink('link-131', 'tess', 'link-131');">tess</a></tt> <tt class="py-op">==</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> <tt id="link-132" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-132', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-133" class="py-name"><a title="pyprocessing.globs.shape.tess" class="py-name" href="#" onclick="return doclink('link-133', 'tess', 'link-131');">tess</a></tt> <tt class="py-op">=</tt> <tt class="py-name">gl</tt><tt class="py-op">.</tt><tt id="link-134" class="py-name" targets="Variable pyprocessing.lights'.gluNewTess=pyprocessing.lights%27-module.html#gluNewTess"><a title="pyprocessing.lights'.gluNewTess" class="py-name" href="#" onclick="return doclink('link-134', 'gluNewTess', 'link-134');">gluNewTess</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L104"></a><tt class="py-lineno">104</tt>  <tt class="py-line">            <tt class="py-comment"># set up the tesselator callbacks</tt> </tt>
<a name="L105"></a><tt class="py-lineno">105</tt>  <tt class="py-line"><tt class="py-comment"></tt>            <tt id="link-135" class="py-name" targets="Variable pyprocessing.lights'.gluTessCallback=pyprocessing.lights%27-module.html#gluTessCallback"><a title="pyprocessing.lights'.gluTessCallback" class="py-name" href="#" onclick="return doclink('link-135', 'gluTessCallback', 'link-135');">gluTessCallback</a></tt><tt class="py-op">(</tt><tt id="link-136" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-136', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-137" class="py-name"><a title="pyprocessing.globs.shape.tess" class="py-name" href="#" onclick="return doclink('link-137', 'tess', 'link-131');">tess</a></tt><tt class="py-op">,</tt> <tt id="link-138" class="py-name" targets="Variable pyprocessing.lights'.GLU_TESS_VERTEX=pyprocessing.lights%27-module.html#GLU_TESS_VERTEX"><a title="pyprocessing.lights'.GLU_TESS_VERTEX" class="py-name" href="#" onclick="return doclink('link-138', 'GLU_TESS_VERTEX', 'link-138');">GLU_TESS_VERTEX</a></tt><tt class="py-op">,</tt> <tt class="py-name">ctypes</tt><tt class="py-op">.</tt><tt class="py-name">cast</tt><tt class="py-op">(</tt><tt id="link-139" class="py-name" targets="Variable pyprocessing.lights'.glVertex3dv=pyprocessing.lights%27-module.html#glVertex3dv"><a title="pyprocessing.lights'.glVertex3dv" class="py-name" href="#" onclick="return doclink('link-139', 'glVertex3dv', 'link-139');">glVertex3dv</a></tt><tt class="py-op">,</tt><tt class="py-name">ctypes</tt><tt class="py-op">.</tt><tt class="py-name">CFUNCTYPE</tt><tt class="py-op">(</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L106"></a><tt class="py-lineno">106</tt>  <tt class="py-line">            <tt id="link-140" class="py-name"><a title="pyprocessing.lights'.gluTessCallback" class="py-name" href="#" onclick="return doclink('link-140', 'gluTessCallback', 'link-135');">gluTessCallback</a></tt><tt class="py-op">(</tt><tt id="link-141" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-141', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-142" class="py-name"><a title="pyprocessing.globs.shape.tess" class="py-name" href="#" onclick="return doclink('link-142', 'tess', 'link-131');">tess</a></tt><tt class="py-op">,</tt> <tt id="link-143" class="py-name" targets="Variable pyprocessing.lights'.GLU_TESS_BEGIN=pyprocessing.lights%27-module.html#GLU_TESS_BEGIN"><a title="pyprocessing.lights'.GLU_TESS_BEGIN" class="py-name" href="#" onclick="return doclink('link-143', 'GLU_TESS_BEGIN', 'link-143');">GLU_TESS_BEGIN</a></tt><tt class="py-op">,</tt> <tt class="py-name">ctypes</tt><tt class="py-op">.</tt><tt class="py-name">cast</tt><tt class="py-op">(</tt><tt id="link-144" class="py-name"><a title="pyprocessing.lights'.glBegin" class="py-name" href="#" onclick="return doclink('link-144', 'glBegin', 'link-91');">glBegin</a></tt><tt class="py-op">,</tt><tt class="py-name">ctypes</tt><tt class="py-op">.</tt><tt class="py-name">CFUNCTYPE</tt><tt class="py-op">(</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L107"></a><tt class="py-lineno">107</tt>  <tt class="py-line">            <tt id="link-145" class="py-name"><a title="pyprocessing.lights'.gluTessCallback" class="py-name" href="#" onclick="return doclink('link-145', 'gluTessCallback', 'link-135');">gluTessCallback</a></tt><tt class="py-op">(</tt><tt id="link-146" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-146', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-147" class="py-name"><a title="pyprocessing.globs.shape.tess" class="py-name" href="#" onclick="return doclink('link-147', 'tess', 'link-131');">tess</a></tt><tt class="py-op">,</tt> <tt id="link-148" class="py-name" targets="Variable pyprocessing.lights'.GLU_TESS_END=pyprocessing.lights%27-module.html#GLU_TESS_END"><a title="pyprocessing.lights'.GLU_TESS_END" class="py-name" href="#" onclick="return doclink('link-148', 'GLU_TESS_END', 'link-148');">GLU_TESS_END</a></tt><tt class="py-op">,</tt> <tt class="py-name">ctypes</tt><tt class="py-op">.</tt><tt class="py-name">cast</tt><tt class="py-op">(</tt><tt id="link-149" class="py-name"><a title="pyprocessing.lights'.glEnd" class="py-name" href="#" onclick="return doclink('link-149', 'glEnd', 'link-100');">glEnd</a></tt><tt class="py-op">,</tt><tt class="py-name">ctypes</tt><tt class="py-op">.</tt><tt class="py-name">CFUNCTYPE</tt><tt class="py-op">(</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L108"></a><tt class="py-lineno">108</tt>  <tt class="py-line">            <tt id="link-150" class="py-name" targets="Variable pyprocessing.lights'.gluTessBeginPolygon=pyprocessing.lights%27-module.html#gluTessBeginPolygon"><a title="pyprocessing.lights'.gluTessBeginPolygon" class="py-name" href="#" onclick="return doclink('link-150', 'gluTessBeginPolygon', 'link-150');">gluTessBeginPolygon</a></tt><tt class="py-op">(</tt><tt id="link-151" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-151', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-152" class="py-name"><a title="pyprocessing.globs.shape.tess" class="py-name" href="#" onclick="return doclink('link-152', 'tess', 'link-131');">tess</a></tt><tt class="py-op">,</tt> <tt class="py-name">None</tt><tt class="py-op">)</tt> </tt>
<a name="L109"></a><tt class="py-lineno">109</tt>  <tt class="py-line">            <tt id="link-153" class="py-name" targets="Variable pyprocessing.lights'.gluTessBeginContour=pyprocessing.lights%27-module.html#gluTessBeginContour"><a title="pyprocessing.lights'.gluTessBeginContour" class="py-name" href="#" onclick="return doclink('link-153', 'gluTessBeginContour', 'link-153');">gluTessBeginContour</a></tt><tt class="py-op">(</tt><tt id="link-154" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-154', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-155" class="py-name"><a title="pyprocessing.globs.shape.tess" class="py-name" href="#" onclick="return doclink('link-155', 'tess', 'link-131');">tess</a></tt><tt class="py-op">)</tt> </tt>
<a name="L110"></a><tt class="py-lineno">110</tt>  <tt class="py-line">            <tt class="py-name">i</tt> <tt class="py-op">=</tt> <tt class="py-number">0</tt> </tt>
<a name="L111"></a><tt class="py-lineno">111</tt>  <tt class="py-line">            <tt class="py-name">n</tt> <tt class="py-op">=</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt id="link-156" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-156', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-157" class="py-name"><a title="pyprocessing.globs.shape.vtx" class="py-name" href="#" onclick="return doclink('link-157', 'vtx', 'link-10');">vtx</a></tt><tt class="py-op">)</tt> </tt>
<a name="L112"></a><tt class="py-lineno">112</tt>  <tt class="py-line">            <tt id="link-158" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-158', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt class="py-name">bez</tt> <tt class="py-op">+=</tt> <tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt> </tt>
<a name="L113"></a><tt class="py-lineno">113</tt>  <tt class="py-line">            <tt class="py-name">b</tt> <tt class="py-op">=</tt> <tt class="py-number">0</tt> </tt>
<a name="L114"></a><tt class="py-lineno">114</tt>  <tt class="py-line">            <tt class="py-name">a</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
<a name="L115"></a><tt class="py-lineno">115</tt>  <tt class="py-line">            <tt class="py-keyword">while</tt> <tt class="py-name">i</tt><tt class="py-op">&lt;</tt><tt class="py-name">n</tt><tt class="py-op">:</tt> </tt>
<a name="L116"></a><tt class="py-lineno">116</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt class="py-name">i</tt> <tt class="py-op">==</tt> <tt id="link-159" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-159', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt class="py-name">bez</tt><tt class="py-op">[</tt><tt class="py-name">b</tt><tt class="py-op">]</tt><tt class="py-op">:</tt> </tt>
<a name="L117"></a><tt class="py-lineno">117</tt>  <tt class="py-line">                    <tt class="py-keyword">for</tt> <tt class="py-name">v</tt> <tt class="py-keyword">in</tt> <tt id="link-160" class="py-name" targets="Function pyprocessing.shapes.bezierSample()=pyprocessing.shapes-module.html#bezierSample"><a title="pyprocessing.shapes.bezierSample" class="py-name" href="#" onclick="return doclink('link-160', 'bezierSample', 'link-160');">bezierSample</a></tt> <tt class="py-op">(</tt><tt id="link-161" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-161', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-162" class="py-name"><a title="pyprocessing.globs.shape.vtx" class="py-name" href="#" onclick="return doclink('link-162', 'vtx', 'link-10');">vtx</a></tt><tt class="py-op">[</tt><tt class="py-name">i</tt><tt class="py-op">-</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt id="link-163" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-163', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-164" class="py-name"><a title="pyprocessing.globs.shape.vtx" class="py-name" href="#" onclick="return doclink('link-164', 'vtx', 'link-10');">vtx</a></tt><tt class="py-op">[</tt><tt class="py-name">i</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
<a name="L118"></a><tt class="py-lineno">118</tt>  <tt class="py-line">                                          <tt id="link-165" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-165', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-166" class="py-name"><a title="pyprocessing.globs.shape.vtx" class="py-name" href="#" onclick="return doclink('link-166', 'vtx', 'link-10');">vtx</a></tt><tt class="py-op">[</tt><tt class="py-name">i</tt><tt class="py-op">+</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt id="link-167" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-167', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-168" class="py-name"><a title="pyprocessing.globs.shape.vtx" class="py-name" href="#" onclick="return doclink('link-168', 'vtx', 'link-10');">vtx</a></tt><tt class="py-op">[</tt><tt class="py-name">i</tt><tt class="py-op">+</tt><tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L119"></a><tt class="py-lineno">119</tt>  <tt class="py-line">                        <tt class="py-name">a</tt> <tt class="py-op">+=</tt> <tt class="py-op">[</tt><tt class="py-op">(</tt><tt class="py-name">ctypes</tt><tt class="py-op">.</tt><tt class="py-name">c_double</tt> <tt class="py-op">*</tt> <tt class="py-number">3</tt><tt class="py-op">)</tt><tt class="py-op">(</tt><tt class="py-op">*</tt><tt class="py-name">v</tt><tt class="py-op">)</tt><tt class="py-op">]</tt> </tt>
<a name="L120"></a><tt class="py-lineno">120</tt>  <tt class="py-line">                        <tt id="link-169" class="py-name" targets="Variable pyprocessing.lights'.gluTessVertex=pyprocessing.lights%27-module.html#gluTessVertex"><a title="pyprocessing.lights'.gluTessVertex" class="py-name" href="#" onclick="return doclink('link-169', 'gluTessVertex', 'link-169');">gluTessVertex</a></tt><tt class="py-op">(</tt><tt id="link-170" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-170', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-171" class="py-name"><a title="pyprocessing.globs.shape.tess" class="py-name" href="#" onclick="return doclink('link-171', 'tess', 'link-131');">tess</a></tt><tt class="py-op">,</tt> <tt class="py-name">a</tt><tt class="py-op">[</tt><tt class="py-op">-</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> <tt class="py-name">a</tt><tt class="py-op">[</tt><tt class="py-op">-</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L121"></a><tt class="py-lineno">121</tt>  <tt class="py-line">                    <tt class="py-name">b</tt> <tt class="py-op">+=</tt> <tt class="py-number">1</tt> </tt>
<a name="L122"></a><tt class="py-lineno">122</tt>  <tt class="py-line">                    <tt class="py-name">i</tt> <tt class="py-op">+=</tt> <tt class="py-number">3</tt> </tt>
<a name="L123"></a><tt class="py-lineno">123</tt>  <tt class="py-line">                <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L124"></a><tt class="py-lineno">124</tt>  <tt class="py-line">                    <tt class="py-name">v</tt> <tt class="py-op">=</tt> <tt id="link-172" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-172', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-173" class="py-name"><a title="pyprocessing.globs.shape.vtx" class="py-name" href="#" onclick="return doclink('link-173', 'vtx', 'link-10');">vtx</a></tt><tt class="py-op">[</tt><tt class="py-name">i</tt><tt class="py-op">]</tt> </tt>
<a name="L125"></a><tt class="py-lineno">125</tt>  <tt class="py-line">                    <tt class="py-name">a</tt> <tt class="py-op">+=</tt> <tt class="py-op">[</tt><tt class="py-op">(</tt><tt class="py-name">ctypes</tt><tt class="py-op">.</tt><tt class="py-name">c_double</tt> <tt class="py-op">*</tt> <tt class="py-number">3</tt><tt class="py-op">)</tt><tt class="py-op">(</tt><tt class="py-op">*</tt><tt class="py-name">v</tt><tt class="py-op">)</tt><tt class="py-op">]</tt> </tt>
<a name="L126"></a><tt class="py-lineno">126</tt>  <tt class="py-line">                    <tt class="py-name">i</tt> <tt class="py-op">+=</tt> <tt class="py-number">1</tt> </tt>
<a name="L127"></a><tt class="py-lineno">127</tt>  <tt class="py-line">                    <tt id="link-174" class="py-name"><a title="pyprocessing.lights'.gluTessVertex" class="py-name" href="#" onclick="return doclink('link-174', 'gluTessVertex', 'link-169');">gluTessVertex</a></tt><tt class="py-op">(</tt><tt id="link-175" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-175', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-176" class="py-name"><a title="pyprocessing.globs.shape.tess" class="py-name" href="#" onclick="return doclink('link-176', 'tess', 'link-131');">tess</a></tt><tt class="py-op">,</tt> <tt class="py-name">a</tt><tt class="py-op">[</tt><tt class="py-op">-</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> <tt class="py-name">a</tt><tt class="py-op">[</tt><tt class="py-op">-</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L128"></a><tt class="py-lineno">128</tt>  <tt class="py-line">            <tt id="link-177" class="py-name" targets="Variable pyprocessing.lights'.gluTessEndContour=pyprocessing.lights%27-module.html#gluTessEndContour"><a title="pyprocessing.lights'.gluTessEndContour" class="py-name" href="#" onclick="return doclink('link-177', 'gluTessEndContour', 'link-177');">gluTessEndContour</a></tt> <tt class="py-op">(</tt><tt id="link-178" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-178', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-179" class="py-name"><a title="pyprocessing.globs.shape.tess" class="py-name" href="#" onclick="return doclink('link-179', 'tess', 'link-131');">tess</a></tt><tt class="py-op">)</tt> </tt>
<a name="L129"></a><tt class="py-lineno">129</tt>  <tt class="py-line">            <tt id="link-180" class="py-name" targets="Variable pyprocessing.lights'.gluTessEndPolygon=pyprocessing.lights%27-module.html#gluTessEndPolygon"><a title="pyprocessing.lights'.gluTessEndPolygon" class="py-name" href="#" onclick="return doclink('link-180', 'gluTessEndPolygon', 'link-180');">gluTessEndPolygon</a></tt> <tt class="py-op">(</tt><tt id="link-181" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-181', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-182" class="py-name"><a title="pyprocessing.globs.shape.tess" class="py-name" href="#" onclick="return doclink('link-182', 'tess', 'link-131');">tess</a></tt><tt class="py-op">)</tt> </tt>
<a name="L130"></a><tt class="py-lineno">130</tt>  <tt class="py-line">            <tt id="link-183" class="py-name"><a title="pyprocessing.primitives._smoothFixHackEnd" class="py-name" href="#" onclick="return doclink('link-183', '_smoothFixHackEnd', 'link-5');">_smoothFixHackEnd</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L131"></a><tt class="py-lineno">131</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L132"></a><tt class="py-lineno">132</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt id="link-184" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-184', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-185" class="py-name"><a title="pyprocessing.globs.shape.nrm" class="py-name" href="#" onclick="return doclink('link-185', 'nrm', 'link-14');">nrm</a></tt> <tt class="py-op">!=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">:</tt> </tt>
<a name="L133"></a><tt class="py-lineno">133</tt>  <tt class="py-line">                <tt class="py-comment"># User supplied normals</tt> </tt>
<a name="L134"></a><tt class="py-lineno">134</tt>  <tt class="py-line"><tt class="py-comment"></tt>                <tt class="py-name">inrm</tt> <tt class="py-op">=</tt> <tt class="py-number">0</tt> </tt>
<a name="L135"></a><tt class="py-lineno">135</tt>  <tt class="py-line">                <tt class="py-name">inormal</tt><tt class="py-op">,</tt><tt id="link-186" class="py-name"><a title="pyprocessing.shapes.normal" class="py-name" href="#" onclick="return doclink('link-186', 'normal', 'link-110');">normal</a></tt> <tt class="py-op">=</tt> <tt id="link-187" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-187', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-188" class="py-name"><a title="pyprocessing.globs.shape.nrm" class="py-name" href="#" onclick="return doclink('link-188', 'nrm', 'link-14');">nrm</a></tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> </tt>
<a name="L136"></a><tt class="py-lineno">136</tt>  <tt class="py-line">                <tt id="link-189" class="py-name"><a title="pyprocessing.lights'.glBegin" class="py-name" href="#" onclick="return doclink('link-189', 'glBegin', 'link-91');">glBegin</a></tt><tt class="py-op">(</tt><tt id="link-190" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-190', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-191" class="py-name"><a title="pyprocessing.globs.shape.type" class="py-name" href="#" onclick="return doclink('link-191', 'type', 'link-7');">type</a></tt><tt class="py-op">)</tt> </tt>
<a name="L137"></a><tt class="py-lineno">137</tt>  <tt class="py-line">                <tt id="link-192" class="py-name"><a title="pyprocessing.lights'.glNormal3f" class="py-name" href="#" onclick="return doclink('link-192', 'glNormal3f', 'link-125');">glNormal3f</a></tt><tt class="py-op">(</tt><tt class="py-op">*</tt><tt id="link-193" class="py-name"><a title="pyprocessing.shapes.normal" class="py-name" href="#" onclick="return doclink('link-193', 'normal', 'link-110');">normal</a></tt><tt class="py-op">)</tt> </tt>
<a name="L138"></a><tt class="py-lineno">138</tt>  <tt class="py-line">                <tt class="py-keyword">for</tt> <tt class="py-name">i</tt><tt class="py-op">,</tt><tt class="py-name">v</tt> <tt class="py-keyword">in</tt> <tt class="py-name">enumerate</tt><tt class="py-op">(</tt><tt id="link-194" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-194', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-195" class="py-name"><a title="pyprocessing.globs.shape.vtx" class="py-name" href="#" onclick="return doclink('link-195', 'vtx', 'link-10');">vtx</a></tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L139"></a><tt class="py-lineno">139</tt>  <tt class="py-line">                    <tt class="py-keyword">if</tt> <tt class="py-name">i</tt><tt class="py-op">==</tt><tt class="py-name">inormal</tt><tt class="py-op">:</tt>  </tt>
<a name="L140"></a><tt class="py-lineno">140</tt>  <tt class="py-line">                        <tt class="py-comment"># load the next normal before proceeding</tt> </tt>
<a name="L141"></a><tt class="py-lineno">141</tt>  <tt class="py-line"><tt class="py-comment"></tt>                        <tt id="link-196" class="py-name"><a title="pyprocessing.lights'.glNormal3f" class="py-name" href="#" onclick="return doclink('link-196', 'glNormal3f', 'link-125');">glNormal3f</a></tt><tt class="py-op">(</tt><tt class="py-op">*</tt><tt id="link-197" class="py-name"><a title="pyprocessing.shapes.normal" class="py-name" href="#" onclick="return doclink('link-197', 'normal', 'link-110');">normal</a></tt><tt class="py-op">)</tt> </tt>
<a name="L142"></a><tt class="py-lineno">142</tt>  <tt class="py-line">                        <tt class="py-name">inrm</tt><tt class="py-op">+=</tt><tt class="py-number">1</tt> </tt>
<a name="L143"></a><tt class="py-lineno">143</tt>  <tt class="py-line">                        <tt class="py-keyword">if</tt> <tt class="py-name">inrm</tt><tt class="py-op">&lt;</tt><tt class="py-name">len</tt><tt class="py-op">(</tt><tt id="link-198" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-198', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-199" class="py-name"><a title="pyprocessing.globs.shape.nrm" class="py-name" href="#" onclick="return doclink('link-199', 'nrm', 'link-14');">nrm</a></tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L144"></a><tt class="py-lineno">144</tt>  <tt class="py-line">                            <tt class="py-name">inormal</tt><tt class="py-op">,</tt> <tt id="link-200" class="py-name"><a title="pyprocessing.shapes.normal" class="py-name" href="#" onclick="return doclink('link-200', 'normal', 'link-110');">normal</a></tt> <tt class="py-op">=</tt> <tt id="link-201" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-201', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-202" class="py-name"><a title="pyprocessing.globs.shape.nrm" class="py-name" href="#" onclick="return doclink('link-202', 'nrm', 'link-14');">nrm</a></tt><tt class="py-op">[</tt><tt class="py-name">inrm</tt><tt class="py-op">]</tt> </tt>
<a name="L145"></a><tt class="py-lineno">145</tt>  <tt class="py-line">                    <tt id="link-203" class="py-name"><a title="pyprocessing.lights'.glVertex3f" class="py-name" href="#" onclick="return doclink('link-203', 'glVertex3f', 'link-99');">glVertex3f</a></tt><tt class="py-op">(</tt><tt class="py-op">*</tt><tt class="py-name">v</tt><tt class="py-op">)</tt> </tt>
<a name="L146"></a><tt class="py-lineno">146</tt>  <tt class="py-line">                <tt id="link-204" class="py-name"><a title="pyprocessing.lights'.glEnd" class="py-name" href="#" onclick="return doclink('link-204', 'glEnd', 'link-100');">glEnd</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L147"></a><tt class="py-lineno">147</tt>  <tt class="py-line">            <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L148"></a><tt class="py-lineno">148</tt>  <tt class="py-line">                <tt class="py-comment"># No normals were specified. Must compute normals on the fly</tt> </tt>
<a name="L149"></a><tt class="py-lineno">149</tt>  <tt class="py-line"><tt class="py-comment"></tt>                <tt id="link-205" class="py-name"><a title="pyprocessing.lights'.glBegin" class="py-name" href="#" onclick="return doclink('link-205', 'glBegin', 'link-91');">glBegin</a></tt><tt class="py-op">(</tt><tt id="link-206" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-206', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-207" class="py-name"><a title="pyprocessing.globs.shape.type" class="py-name" href="#" onclick="return doclink('link-207', 'type', 'link-7');">type</a></tt><tt class="py-op">)</tt> </tt>
<a name="L150"></a><tt class="py-lineno">150</tt>  <tt class="py-line">                <tt class="py-keyword">for</tt> <tt class="py-name">i</tt><tt class="py-op">,</tt><tt class="py-name">v</tt> <tt class="py-keyword">in</tt> <tt class="py-name">enumerate</tt><tt class="py-op">(</tt><tt id="link-208" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-208', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-209" class="py-name"><a title="pyprocessing.globs.shape.vtx" class="py-name" href="#" onclick="return doclink('link-209', 'vtx', 'link-10');">vtx</a></tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L151"></a><tt class="py-lineno">151</tt>  <tt class="py-line">                    <tt class="py-keyword">if</tt> <tt class="py-name">i</tt><tt class="py-op">+</tt><tt class="py-number">2</tt> <tt class="py-op">&lt;</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt id="link-210" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-210', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-211" class="py-name"><a title="pyprocessing.globs.shape.vtx" class="py-name" href="#" onclick="return doclink('link-211', 'vtx', 'link-10');">vtx</a></tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L152"></a><tt class="py-lineno">152</tt>  <tt class="py-line">                        <tt class="py-keyword">if</tt> <tt id="link-212" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-212', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-213" class="py-name"><a title="pyprocessing.globs.shape.type" class="py-name" href="#" onclick="return doclink('link-213', 'type', 'link-7');">type</a></tt><tt class="py-op">==</tt><tt id="link-214" class="py-name" targets="Variable pyprocessing.constants.QUADS=pyprocessing.constants-module.html#QUADS,Variable pyprocessing.lights'.QUADS=pyprocessing.lights%27-module.html#QUADS"><a title="pyprocessing.constants.QUADS
pyprocessing.lights'.QUADS" class="py-name" href="#" onclick="return doclink('link-214', 'QUADS', 'link-214');">QUADS</a></tt> <tt class="py-keyword">and</tt> <tt class="py-name">i</tt><tt class="py-op">%</tt><tt class="py-number">4</tt><tt class="py-op">==</tt><tt class="py-number">0</tt> <tt class="py-keyword">or</tt> \ </tt>
<a name="L153"></a><tt class="py-lineno">153</tt>  <tt class="py-line">                           <tt id="link-215" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-215', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-216" class="py-name"><a title="pyprocessing.globs.shape.type" class="py-name" href="#" onclick="return doclink('link-216', 'type', 'link-7');">type</a></tt><tt class="py-op">==</tt><tt id="link-217" class="py-name" targets="Variable pyprocessing.constants.QUAD_STRIP=pyprocessing.constants-module.html#QUAD_STRIP,Variable pyprocessing.lights'.QUAD_STRIP=pyprocessing.lights%27-module.html#QUAD_STRIP"><a title="pyprocessing.constants.QUAD_STRIP
pyprocessing.lights'.QUAD_STRIP" class="py-name" href="#" onclick="return doclink('link-217', 'QUAD_STRIP', 'link-217');">QUAD_STRIP</a></tt> <tt class="py-keyword">and</tt> <tt class="py-name">i</tt><tt class="py-op">%</tt><tt class="py-number">2</tt><tt class="py-op">==</tt><tt class="py-number">0</tt> <tt class="py-keyword">or</tt> \ </tt>
<a name="L154"></a><tt class="py-lineno">154</tt>  <tt class="py-line">                           <tt id="link-218" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-218', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-219" class="py-name"><a title="pyprocessing.globs.shape.type" class="py-name" href="#" onclick="return doclink('link-219', 'type', 'link-7');">type</a></tt><tt class="py-op">==</tt><tt id="link-220" class="py-name" targets="Variable pyprocessing.constants.TRIANGLES=pyprocessing.constants-module.html#TRIANGLES,Variable pyprocessing.lights'.TRIANGLES=pyprocessing.lights%27-module.html#TRIANGLES"><a title="pyprocessing.constants.TRIANGLES
pyprocessing.lights'.TRIANGLES" class="py-name" href="#" onclick="return doclink('link-220', 'TRIANGLES', 'link-220');">TRIANGLES</a></tt> <tt class="py-keyword">and</tt> <tt class="py-name">i</tt><tt class="py-op">%</tt><tt class="py-number">3</tt><tt class="py-op">==</tt><tt class="py-number">0</tt> <tt class="py-keyword">or</tt> \ </tt>
<a name="L155"></a><tt class="py-lineno">155</tt>  <tt class="py-line">                           <tt id="link-221" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-221', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-222" class="py-name"><a title="pyprocessing.globs.shape.type" class="py-name" href="#" onclick="return doclink('link-222', 'type', 'link-7');">type</a></tt><tt class="py-op">==</tt><tt id="link-223" class="py-name" targets="Variable pyprocessing.constants.TRIANGLE_FAN=pyprocessing.constants-module.html#TRIANGLE_FAN,Variable pyprocessing.lights'.TRIANGLE_FAN=pyprocessing.lights%27-module.html#TRIANGLE_FAN"><a title="pyprocessing.constants.TRIANGLE_FAN
pyprocessing.lights'.TRIANGLE_FAN" class="py-name" href="#" onclick="return doclink('link-223', 'TRIANGLE_FAN', 'link-223');">TRIANGLE_FAN</a></tt> <tt class="py-keyword">and</tt> <tt class="py-name">i</tt><tt class="py-op">&gt;</tt><tt class="py-number">1</tt> <tt class="py-keyword">or</tt> \ </tt>
<a name="L156"></a><tt class="py-lineno">156</tt>  <tt class="py-line">                           <tt id="link-224" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-224', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-225" class="py-name"><a title="pyprocessing.globs.shape.type" class="py-name" href="#" onclick="return doclink('link-225', 'type', 'link-7');">type</a></tt><tt class="py-op">==</tt><tt id="link-226" class="py-name" targets="Variable pyprocessing.constants.TRIANGLE_STRIP=pyprocessing.constants-module.html#TRIANGLE_STRIP,Variable pyprocessing.lights'.TRIANGLE_STRIP=pyprocessing.lights%27-module.html#TRIANGLE_STRIP"><a title="pyprocessing.constants.TRIANGLE_STRIP
pyprocessing.lights'.TRIANGLE_STRIP" class="py-name" href="#" onclick="return doclink('link-226', 'TRIANGLE_STRIP', 'link-226');">TRIANGLE_STRIP</a></tt> <tt class="py-keyword">and</tt> <tt class="py-name">i</tt><tt class="py-op">&gt;</tt><tt class="py-number">1</tt><tt class="py-op">:</tt> </tt>
<a name="L157"></a><tt class="py-lineno">157</tt>  <tt class="py-line">                            <tt id="link-227" class="py-name"><a title="pyprocessing.shapes.normal" class="py-name" href="#" onclick="return doclink('link-227', 'normal', 'link-110');">normal</a></tt> <tt class="py-op">=</tt> <tt class="py-name">computeNormal</tt><tt class="py-op">(</tt><tt id="link-228" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-228', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-229" class="py-name"><a title="pyprocessing.globs.shape.vtx" class="py-name" href="#" onclick="return doclink('link-229', 'vtx', 'link-10');">vtx</a></tt><tt class="py-op">[</tt><tt class="py-name">i</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt id="link-230" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-230', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-231" class="py-name"><a title="pyprocessing.globs.shape.vtx" class="py-name" href="#" onclick="return doclink('link-231', 'vtx', 'link-10');">vtx</a></tt><tt class="py-op">[</tt><tt class="py-name">i</tt><tt class="py-op">+</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt id="link-232" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-232', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-233" class="py-name"><a title="pyprocessing.globs.shape.vtx" class="py-name" href="#" onclick="return doclink('link-233', 'vtx', 'link-10');">vtx</a></tt><tt class="py-op">[</tt><tt class="py-name">i</tt><tt class="py-op">+</tt><tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L158"></a><tt class="py-lineno">158</tt>  <tt class="py-line">                            <tt id="link-234" class="py-name"><a title="pyprocessing.lights'.glNormal3f" class="py-name" href="#" onclick="return doclink('link-234', 'glNormal3f', 'link-125');">glNormal3f</a></tt> <tt class="py-op">(</tt><tt class="py-op">*</tt><tt id="link-235" class="py-name"><a title="pyprocessing.shapes.normal" class="py-name" href="#" onclick="return doclink('link-235', 'normal', 'link-110');">normal</a></tt><tt class="py-op">)</tt> </tt>
<a name="L159"></a><tt class="py-lineno">159</tt>  <tt class="py-line">                    <tt id="link-236" class="py-name"><a title="pyprocessing.lights'.glVertex3f" class="py-name" href="#" onclick="return doclink('link-236', 'glVertex3f', 'link-99');">glVertex3f</a></tt><tt class="py-op">(</tt><tt class="py-op">*</tt><tt class="py-name">v</tt><tt class="py-op">)</tt> </tt>
<a name="L160"></a><tt class="py-lineno">160</tt>  <tt class="py-line">                <tt id="link-237" class="py-name"><a title="pyprocessing.lights'.glEnd" class="py-name" href="#" onclick="return doclink('link-237', 'glEnd', 'link-100');">glEnd</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L161"></a><tt class="py-lineno">161</tt>  <tt class="py-line">                 </tt>
<a name="L162"></a><tt class="py-lineno">162</tt>  <tt class="py-line">                 </tt>
<a name="L163"></a><tt class="py-lineno">163</tt>  <tt class="py-line">                 </tt>
<a name="L164"></a><tt class="py-lineno">164</tt>  <tt class="py-line">    <tt class="py-comment"># Draw the outline of the shape</tt> </tt>
<a name="L165"></a><tt class="py-lineno">165</tt>  <tt class="py-line"><tt class="py-comment"></tt>    <tt class="py-keyword">if</tt> <tt id="link-238" class="py-name"><a title="pyprocessing.globs.attrib" class="py-name" href="#" onclick="return doclink('link-238', 'attrib', 'link-15');">attrib</a></tt><tt class="py-op">.</tt><tt id="link-239" class="py-name" targets="Variable pyprocessing.globs.attrib.strokeColor=pyprocessing.globs.attrib-class.html#strokeColor"><a title="pyprocessing.globs.attrib.strokeColor" class="py-name" href="#" onclick="return doclink('link-239', 'strokeColor', 'link-239');">strokeColor</a></tt> <tt class="py-op">!=</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L166"></a><tt class="py-lineno">166</tt>  <tt class="py-line">        <tt id="link-240" class="py-name"><a title="pyprocessing.lights'.glColor4f" class="py-name" href="#" onclick="return doclink('link-240', 'glColor4f', 'link-105');">glColor4f</a></tt><tt class="py-op">(</tt><tt class="py-op">*</tt><tt id="link-241" class="py-name"><a title="pyprocessing.globs.attrib" class="py-name" href="#" onclick="return doclink('link-241', 'attrib', 'link-15');">attrib</a></tt><tt class="py-op">.</tt><tt id="link-242" class="py-name"><a title="pyprocessing.globs.attrib.strokeColor" class="py-name" href="#" onclick="return doclink('link-242', 'strokeColor', 'link-239');">strokeColor</a></tt><tt class="py-op">)</tt> </tt>
<a name="L167"></a><tt class="py-lineno">167</tt>  <tt class="py-line">        <tt id="link-243" class="py-name" targets="Variable pyprocessing.lights'.glPushAttrib=pyprocessing.lights%27-module.html#glPushAttrib"><a title="pyprocessing.lights'.glPushAttrib" class="py-name" href="#" onclick="return doclink('link-243', 'glPushAttrib', 'link-243');">glPushAttrib</a></tt><tt class="py-op">(</tt><tt id="link-244" class="py-name" targets="Variable pyprocessing.lights'.GL_POLYGON_BIT=pyprocessing.lights%27-module.html#GL_POLYGON_BIT"><a title="pyprocessing.lights'.GL_POLYGON_BIT" class="py-name" href="#" onclick="return doclink('link-244', 'GL_POLYGON_BIT', 'link-244');">GL_POLYGON_BIT</a></tt><tt class="py-op">)</tt> </tt>
<a name="L168"></a><tt class="py-lineno">168</tt>  <tt class="py-line">        <tt id="link-245" class="py-name" targets="Variable pyprocessing.lights'.glPolygonMode=pyprocessing.lights%27-module.html#glPolygonMode"><a title="pyprocessing.lights'.glPolygonMode" class="py-name" href="#" onclick="return doclink('link-245', 'glPolygonMode', 'link-245');">glPolygonMode</a></tt><tt class="py-op">(</tt><tt id="link-246" class="py-name" targets="Variable pyprocessing.lights'.GL_FRONT_AND_BACK=pyprocessing.lights%27-module.html#GL_FRONT_AND_BACK"><a title="pyprocessing.lights'.GL_FRONT_AND_BACK" class="py-name" href="#" onclick="return doclink('link-246', 'GL_FRONT_AND_BACK', 'link-246');">GL_FRONT_AND_BACK</a></tt><tt class="py-op">,</tt><tt id="link-247" class="py-name" targets="Variable pyprocessing.lights'.GL_LINE=pyprocessing.lights%27-module.html#GL_LINE"><a title="pyprocessing.lights'.GL_LINE" class="py-name" href="#" onclick="return doclink('link-247', 'GL_LINE', 'link-247');">GL_LINE</a></tt><tt class="py-op">)</tt> </tt>
<a name="L169"></a><tt class="py-lineno">169</tt>  <tt class="py-line">        <tt id="link-248" class="py-name" targets="Variable pyprocessing.lights'.glLineWidth=pyprocessing.lights%27-module.html#glLineWidth"><a title="pyprocessing.lights'.glLineWidth" class="py-name" href="#" onclick="return doclink('link-248', 'glLineWidth', 'link-248');">glLineWidth</a></tt> <tt class="py-op">(</tt><tt id="link-249" class="py-name"><a title="pyprocessing.globs.attrib" class="py-name" href="#" onclick="return doclink('link-249', 'attrib', 'link-15');">attrib</a></tt><tt class="py-op">.</tt><tt id="link-250" class="py-name" targets="Function pyprocessing.attribs.strokeWeight()=pyprocessing.attribs-module.html#strokeWeight,Variable pyprocessing.globs.attrib.strokeWeight=pyprocessing.globs.attrib-class.html#strokeWeight"><a title="pyprocessing.attribs.strokeWeight
pyprocessing.globs.attrib.strokeWeight" class="py-name" href="#" onclick="return doclink('link-250', 'strokeWeight', 'link-250');">strokeWeight</a></tt><tt class="py-op">)</tt> </tt>
<a name="L170"></a><tt class="py-lineno">170</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt id="link-251" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-251', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-252" class="py-name"><a title="pyprocessing.globs.shape.type" class="py-name" href="#" onclick="return doclink('link-252', 'type', 'link-7');">type</a></tt><tt class="py-op">==</tt><tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L171"></a><tt class="py-lineno">171</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">close</tt><tt class="py-op">:</tt> <tt id="link-253" class="py-name"><a title="pyprocessing.lights'.glBegin" class="py-name" href="#" onclick="return doclink('link-253', 'glBegin', 'link-91');">glBegin</a></tt><tt class="py-op">(</tt><tt id="link-254" class="py-name" targets="Variable pyprocessing.lights'.GL_LINE_LOOP=pyprocessing.lights%27-module.html#GL_LINE_LOOP"><a title="pyprocessing.lights'.GL_LINE_LOOP" class="py-name" href="#" onclick="return doclink('link-254', 'GL_LINE_LOOP', 'link-254');">GL_LINE_LOOP</a></tt><tt class="py-op">)</tt> </tt>
<a name="L172"></a><tt class="py-lineno">172</tt>  <tt class="py-line">            <tt class="py-keyword">else</tt><tt class="py-op">:</tt> <tt id="link-255" class="py-name"><a title="pyprocessing.lights'.glBegin" class="py-name" href="#" onclick="return doclink('link-255', 'glBegin', 'link-91');">glBegin</a></tt><tt class="py-op">(</tt><tt id="link-256" class="py-name" targets="Variable pyprocessing.lights'.GL_LINE_STRIP=pyprocessing.lights%27-module.html#GL_LINE_STRIP"><a title="pyprocessing.lights'.GL_LINE_STRIP" class="py-name" href="#" onclick="return doclink('link-256', 'GL_LINE_STRIP', 'link-256');">GL_LINE_STRIP</a></tt><tt class="py-op">)</tt> </tt>
<a name="L173"></a><tt class="py-lineno">173</tt>  <tt class="py-line">            <tt class="py-name">i</tt> <tt class="py-op">=</tt> <tt class="py-number">0</tt> </tt>
<a name="L174"></a><tt class="py-lineno">174</tt>  <tt class="py-line">            <tt class="py-name">n</tt> <tt class="py-op">=</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt id="link-257" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-257', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-258" class="py-name"><a title="pyprocessing.globs.shape.vtx" class="py-name" href="#" onclick="return doclink('link-258', 'vtx', 'link-10');">vtx</a></tt><tt class="py-op">)</tt> </tt>
<a name="L175"></a><tt class="py-lineno">175</tt>  <tt class="py-line">            <tt id="link-259" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-259', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt class="py-name">bez</tt> <tt class="py-op">+=</tt> <tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt> </tt>
<a name="L176"></a><tt class="py-lineno">176</tt>  <tt class="py-line">            <tt class="py-name">nextbez</tt> <tt class="py-op">=</tt> <tt id="link-260" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-260', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt class="py-name">bez</tt><tt class="py-op">.</tt><tt class="py-name">pop</tt><tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">)</tt> </tt>
<a name="L177"></a><tt class="py-lineno">177</tt>  <tt class="py-line">            <tt class="py-keyword">while</tt> <tt class="py-name">i</tt><tt class="py-op">&lt;</tt><tt class="py-name">n</tt><tt class="py-op">:</tt> </tt>
<a name="L178"></a><tt class="py-lineno">178</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt class="py-name">i</tt> <tt class="py-op">==</tt> <tt class="py-name">nextbez</tt><tt class="py-op">:</tt> </tt>
<a name="L179"></a><tt class="py-lineno">179</tt>  <tt class="py-line">                    <tt class="py-keyword">for</tt> <tt class="py-name">v</tt> <tt class="py-keyword">in</tt> <tt id="link-261" class="py-name"><a title="pyprocessing.shapes.bezierSample" class="py-name" href="#" onclick="return doclink('link-261', 'bezierSample', 'link-160');">bezierSample</a></tt> <tt class="py-op">(</tt><tt id="link-262" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-262', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-263" class="py-name"><a title="pyprocessing.globs.shape.vtx" class="py-name" href="#" onclick="return doclink('link-263', 'vtx', 'link-10');">vtx</a></tt><tt class="py-op">[</tt><tt class="py-name">i</tt><tt class="py-op">-</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt id="link-264" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-264', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-265" class="py-name"><a title="pyprocessing.globs.shape.vtx" class="py-name" href="#" onclick="return doclink('link-265', 'vtx', 'link-10');">vtx</a></tt><tt class="py-op">[</tt><tt class="py-name">i</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
<a name="L180"></a><tt class="py-lineno">180</tt>  <tt class="py-line">                                          <tt id="link-266" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-266', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-267" class="py-name"><a title="pyprocessing.globs.shape.vtx" class="py-name" href="#" onclick="return doclink('link-267', 'vtx', 'link-10');">vtx</a></tt><tt class="py-op">[</tt><tt class="py-name">i</tt><tt class="py-op">+</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt id="link-268" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-268', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-269" class="py-name"><a title="pyprocessing.globs.shape.vtx" class="py-name" href="#" onclick="return doclink('link-269', 'vtx', 'link-10');">vtx</a></tt><tt class="py-op">[</tt><tt class="py-name">i</tt><tt class="py-op">+</tt><tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L181"></a><tt class="py-lineno">181</tt>  <tt class="py-line">                        <tt id="link-270" class="py-name"><a title="pyprocessing.lights'.glVertex3f" class="py-name" href="#" onclick="return doclink('link-270', 'glVertex3f', 'link-99');">glVertex3f</a></tt><tt class="py-op">(</tt><tt class="py-op">*</tt><tt class="py-name">v</tt><tt class="py-op">)</tt> </tt>
<a name="L182"></a><tt class="py-lineno">182</tt>  <tt class="py-line">                    <tt class="py-name">nextbez</tt> <tt class="py-op">=</tt> <tt id="link-271" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-271', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt class="py-name">bez</tt><tt class="py-op">.</tt><tt class="py-name">pop</tt><tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">)</tt> </tt>
<a name="L183"></a><tt class="py-lineno">183</tt>  <tt class="py-line">                    <tt class="py-name">i</tt> <tt class="py-op">+=</tt> <tt class="py-number">3</tt> </tt>
<a name="L184"></a><tt class="py-lineno">184</tt>  <tt class="py-line">                <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L185"></a><tt class="py-lineno">185</tt>  <tt class="py-line">                    <tt class="py-name">v</tt> <tt class="py-op">=</tt> <tt id="link-272" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-272', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-273" class="py-name"><a title="pyprocessing.globs.shape.vtx" class="py-name" href="#" onclick="return doclink('link-273', 'vtx', 'link-10');">vtx</a></tt><tt class="py-op">[</tt><tt class="py-name">i</tt><tt class="py-op">]</tt> </tt>
<a name="L186"></a><tt class="py-lineno">186</tt>  <tt class="py-line">                    <tt class="py-name">i</tt> <tt class="py-op">+=</tt> <tt class="py-number">1</tt> </tt>
<a name="L187"></a><tt class="py-lineno">187</tt>  <tt class="py-line">                    <tt id="link-274" class="py-name"><a title="pyprocessing.lights'.glVertex3f" class="py-name" href="#" onclick="return doclink('link-274', 'glVertex3f', 'link-99');">glVertex3f</a></tt><tt class="py-op">(</tt><tt class="py-op">*</tt><tt class="py-name">v</tt><tt class="py-op">)</tt> </tt>
<a name="L188"></a><tt class="py-lineno">188</tt>  <tt class="py-line">            <tt id="link-275" class="py-name"><a title="pyprocessing.lights'.glEnd" class="py-name" href="#" onclick="return doclink('link-275', 'glEnd', 'link-100');">glEnd</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L189"></a><tt class="py-lineno">189</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L190"></a><tt class="py-lineno">190</tt>  <tt class="py-line">            <tt id="link-276" class="py-name"><a title="pyprocessing.lights'.glBegin" class="py-name" href="#" onclick="return doclink('link-276', 'glBegin', 'link-91');">glBegin</a></tt><tt class="py-op">(</tt><tt id="link-277" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-277', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-278" class="py-name"><a title="pyprocessing.globs.shape.type" class="py-name" href="#" onclick="return doclink('link-278', 'type', 'link-7');">type</a></tt><tt class="py-op">)</tt> </tt>
<a name="L191"></a><tt class="py-lineno">191</tt>  <tt class="py-line">            <tt class="py-keyword">for</tt> <tt class="py-name">v</tt> <tt class="py-keyword">in</tt> <tt id="link-279" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-279', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-280" class="py-name"><a title="pyprocessing.globs.shape.vtx" class="py-name" href="#" onclick="return doclink('link-280', 'vtx', 'link-10');">vtx</a></tt><tt class="py-op">:</tt> <tt id="link-281" class="py-name"><a title="pyprocessing.lights'.glVertex3f" class="py-name" href="#" onclick="return doclink('link-281', 'glVertex3f', 'link-99');">glVertex3f</a></tt><tt class="py-op">(</tt><tt class="py-op">*</tt><tt class="py-name">v</tt><tt class="py-op">)</tt>         </tt>
<a name="L192"></a><tt class="py-lineno">192</tt>  <tt class="py-line">            <tt id="link-282" class="py-name"><a title="pyprocessing.lights'.glEnd" class="py-name" href="#" onclick="return doclink('link-282', 'glEnd', 'link-100');">glEnd</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L193"></a><tt class="py-lineno">193</tt>  <tt class="py-line">        <tt id="link-283" class="py-name" targets="Variable pyprocessing.lights'.glPopAttrib=pyprocessing.lights%27-module.html#glPopAttrib"><a title="pyprocessing.lights'.glPopAttrib" class="py-name" href="#" onclick="return doclink('link-283', 'glPopAttrib', 'link-283');">glPopAttrib</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="L194"></a><tt class="py-lineno">194</tt>  <tt class="py-line"> </tt>
<a name="bezierDetail"></a><div id="bezierDetail-def"><a name="L195"></a><tt class="py-lineno">195</tt> <a class="py-toggle" href="#" id="bezierDetail-toggle" onclick="return toggle('bezierDetail');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pyprocessing.shapes-module.html#bezierDetail">bezierDetail</a><tt class="py-op">(</tt><tt class="py-param">n</tt><tt class="py-op">=</tt><tt id="link-284" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-284', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-285" class="py-name" targets="Variable pyprocessing.globs.shape.bezierDetail=pyprocessing.globs.shape-class.html#bezierDetail,Function pyprocessing.shapes.bezierDetail()=pyprocessing.shapes-module.html#bezierDetail"><a title="pyprocessing.globs.shape.bezierDetail
pyprocessing.shapes.bezierDetail" class="py-name" href="#" onclick="return doclink('link-285', 'bezierDetail', 'link-285');">bezierDetail</a></tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="bezierDetail-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="bezierDetail-expanded"><a name="L196"></a><tt class="py-lineno">196</tt>  <tt class="py-line">    <tt class="py-docstring">"""Establishes the B&#233;zier level of detail, i.e., the number of points</tt> </tt>
<a name="L197"></a><tt class="py-lineno">197</tt>  <tt class="py-line"><tt class="py-docstring">    per B&#233;zier curve segment."""</tt> </tt>
<a name="L198"></a><tt class="py-lineno">198</tt>  <tt class="py-line">    <tt id="link-286" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-286', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-287" class="py-name"><a title="pyprocessing.globs.shape.bezierDetail
pyprocessing.shapes.bezierDetail" class="py-name" href="#" onclick="return doclink('link-287', 'bezierDetail', 'link-285');">bezierDetail</a></tt> <tt class="py-op">=</tt> <tt class="py-name">n</tt> </tt>
<a name="L199"></a><tt class="py-lineno">199</tt>  <tt class="py-line">    <tt class="py-comment"># precompute blending factors</tt> </tt>
<a name="L200"></a><tt class="py-lineno">200</tt>  <tt class="py-line"><tt class="py-comment"></tt>    <tt id="link-288" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-288', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-289" class="py-name" targets="Variable pyprocessing.globs.shape.bezierBlend=pyprocessing.globs.shape-class.html#bezierBlend"><a title="pyprocessing.globs.shape.bezierBlend" class="py-name" href="#" onclick="return doclink('link-289', 'bezierBlend', 'link-289');">bezierBlend</a></tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
<a name="L201"></a><tt class="py-lineno">201</tt>  <tt class="py-line">    <tt class="py-keyword">for</tt> <tt class="py-name">i</tt> <tt class="py-keyword">in</tt> <tt class="py-name">range</tt><tt class="py-op">(</tt><tt class="py-name">n</tt><tt class="py-op">+</tt><tt class="py-number">1</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L202"></a><tt class="py-lineno">202</tt>  <tt class="py-line">        <tt class="py-name">t</tt> <tt class="py-op">=</tt> <tt class="py-name">float</tt><tt class="py-op">(</tt><tt class="py-name">i</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-name">n</tt> </tt>
<a name="L203"></a><tt class="py-lineno">203</tt>  <tt class="py-line">        <tt class="py-name">u</tt> <tt class="py-op">=</tt> <tt class="py-number">1</tt> <tt class="py-op">-</tt> <tt class="py-name">t</tt> </tt>
<a name="L204"></a><tt class="py-lineno">204</tt>  <tt class="py-line">        <tt id="link-290" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-290', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-291" class="py-name"><a title="pyprocessing.globs.shape.bezierBlend" class="py-name" href="#" onclick="return doclink('link-291', 'bezierBlend', 'link-289');">bezierBlend</a></tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-op">(</tt><tt class="py-name">u</tt><tt class="py-op">*</tt><tt class="py-name">u</tt><tt class="py-op">*</tt><tt class="py-name">u</tt><tt class="py-op">,</tt><tt class="py-number">3</tt><tt class="py-op">*</tt><tt class="py-name">u</tt><tt class="py-op">*</tt><tt class="py-name">u</tt><tt class="py-op">*</tt><tt class="py-name">t</tt><tt class="py-op">,</tt><tt class="py-number">3</tt><tt class="py-op">*</tt><tt class="py-name">t</tt><tt class="py-op">*</tt><tt class="py-name">t</tt><tt class="py-op">*</tt><tt class="py-name">u</tt><tt class="py-op">,</tt><tt class="py-name">t</tt><tt class="py-op">*</tt><tt class="py-name">t</tt><tt class="py-op">*</tt><tt class="py-name">t</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div><a name="L205"></a><tt class="py-lineno">205</tt>  <tt class="py-line"> </tt>
<a name="bezierPoint"></a><div id="bezierPoint-def"><a name="L206"></a><tt class="py-lineno">206</tt> <a class="py-toggle" href="#" id="bezierPoint-toggle" onclick="return toggle('bezierPoint');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pyprocessing.shapes-module.html#bezierPoint">bezierPoint</a> <tt class="py-op">(</tt><tt class="py-param">a</tt><tt class="py-op">,</tt><tt class="py-param">b</tt><tt class="py-op">,</tt><tt class="py-param">c</tt><tt class="py-op">,</tt><tt class="py-param">d</tt><tt class="py-op">,</tt><tt class="py-param">t</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="bezierPoint-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="bezierPoint-expanded"><a name="L207"></a><tt class="py-lineno">207</tt>  <tt class="py-line">    <tt class="py-docstring">"""Given the x or y coordinate of B&#233;zier control points a,b,c,d and</tt> </tt>
<a name="L208"></a><tt class="py-lineno">208</tt>  <tt class="py-line"><tt class="py-docstring">    the value of the t parameter, return the corresponding</tt> </tt>
<a name="L209"></a><tt class="py-lineno">209</tt>  <tt class="py-line"><tt class="py-docstring">    coordinate of the point."""</tt> </tt>
<a name="L210"></a><tt class="py-lineno">210</tt>  <tt class="py-line">    <tt class="py-name">u</tt> <tt class="py-op">=</tt> <tt class="py-number">1.0</tt> <tt class="py-op">-</tt> <tt class="py-name">t</tt> </tt>
<a name="L211"></a><tt class="py-lineno">211</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">a</tt><tt class="py-op">*</tt><tt class="py-name">u</tt><tt class="py-op">*</tt><tt class="py-name">u</tt><tt class="py-op">*</tt><tt class="py-name">u</tt> <tt class="py-op">+</tt> <tt class="py-name">b</tt><tt class="py-op">*</tt><tt class="py-number">3</tt><tt class="py-op">*</tt><tt class="py-name">u</tt><tt class="py-op">*</tt><tt class="py-name">u</tt><tt class="py-op">*</tt><tt class="py-name">t</tt> <tt class="py-op">+</tt> <tt class="py-name">c</tt><tt class="py-op">*</tt><tt class="py-number">3</tt><tt class="py-op">*</tt><tt class="py-name">t</tt><tt class="py-op">*</tt><tt class="py-name">t</tt><tt class="py-op">*</tt><tt class="py-name">u</tt> <tt class="py-op">+</tt> <tt class="py-name">d</tt><tt class="py-op">*</tt><tt class="py-name">t</tt><tt class="py-op">*</tt><tt class="py-name">t</tt><tt class="py-op">*</tt><tt class="py-name">t</tt> </tt>
</div><a name="L212"></a><tt class="py-lineno">212</tt>  <tt class="py-line"> </tt>
<a name="bezierTangent"></a><div id="bezierTangent-def"><a name="L213"></a><tt class="py-lineno">213</tt> <a class="py-toggle" href="#" id="bezierTangent-toggle" onclick="return toggle('bezierTangent');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pyprocessing.shapes-module.html#bezierTangent">bezierTangent</a> <tt class="py-op">(</tt><tt class="py-param">a</tt><tt class="py-op">,</tt><tt class="py-param">b</tt><tt class="py-op">,</tt><tt class="py-param">c</tt><tt class="py-op">,</tt><tt class="py-param">d</tt><tt class="py-op">,</tt><tt class="py-param">t</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="bezierTangent-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="bezierTangent-expanded"><a name="L214"></a><tt class="py-lineno">214</tt>  <tt class="py-line">    <tt class="py-docstring">"""Given the x or y coordinate of B&#233;zier control points a,b,c,d and</tt> </tt>
<a name="L215"></a><tt class="py-lineno">215</tt>  <tt class="py-line"><tt class="py-docstring">    the value of the t parameter, return the corresponding</tt> </tt>
<a name="L216"></a><tt class="py-lineno">216</tt>  <tt class="py-line"><tt class="py-docstring">    coordinate of the tangent at that point."""</tt> </tt>
<a name="L217"></a><tt class="py-lineno">217</tt>  <tt class="py-line">    <tt class="py-name">u</tt> <tt class="py-op">=</tt> <tt class="py-number">1.0</tt> <tt class="py-op">-</tt> <tt class="py-name">t</tt> </tt>
<a name="L218"></a><tt class="py-lineno">218</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-op">-</tt><tt class="py-name">a</tt><tt class="py-op">*</tt><tt class="py-number">3</tt><tt class="py-op">*</tt><tt class="py-name">u</tt><tt class="py-op">*</tt><tt class="py-name">u</tt> <tt class="py-op">+</tt> <tt class="py-name">b</tt><tt class="py-op">*</tt><tt class="py-op">(</tt><tt class="py-number">9</tt><tt class="py-op">*</tt><tt class="py-name">u</tt><tt class="py-op">*</tt><tt class="py-name">u</tt><tt class="py-op">-</tt><tt class="py-number">6</tt><tt class="py-op">*</tt><tt class="py-name">u</tt><tt class="py-op">)</tt> <tt class="py-op">+</tt> <tt class="py-name">c</tt><tt class="py-op">*</tt><tt class="py-op">(</tt><tt class="py-number">6</tt><tt class="py-op">*</tt><tt class="py-name">t</tt><tt class="py-op">-</tt><tt class="py-number">9</tt><tt class="py-op">*</tt><tt class="py-name">t</tt><tt class="py-op">*</tt><tt class="py-name">t</tt><tt class="py-op">)</tt> <tt class="py-op">+</tt> <tt class="py-name">d</tt><tt class="py-op">*</tt><tt class="py-number">3</tt><tt class="py-op">*</tt><tt class="py-name">t</tt><tt class="py-op">*</tt><tt class="py-name">t</tt> </tt>
</div><a name="L219"></a><tt class="py-lineno">219</tt>  <tt class="py-line">     </tt>
<a name="bezierSample"></a><div id="bezierSample-def"><a name="L220"></a><tt class="py-lineno">220</tt> <a class="py-toggle" href="#" id="bezierSample-toggle" onclick="return toggle('bezierSample');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pyprocessing.shapes-module.html#bezierSample">bezierSample</a><tt class="py-op">(</tt><tt class="py-op">*</tt><tt class="py-param">p</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="bezierSample-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="bezierSample-expanded"><a name="L221"></a><tt class="py-lineno">221</tt>  <tt class="py-line">    <tt class="py-docstring">"""Returns a list of points for cubic bezier arc defined by the given</tt> </tt>
<a name="L222"></a><tt class="py-lineno">222</tt>  <tt class="py-line"><tt class="py-docstring">    control points. The number of points is given by shape.bezierDetail."""</tt> </tt>
<a name="L223"></a><tt class="py-lineno">223</tt>  <tt class="py-line">    <tt class="py-keyword">assert</tt> <tt class="py-op">(</tt><tt class="py-name">len</tt> <tt class="py-op">(</tt><tt class="py-name">p</tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-number">4</tt><tt class="py-op">)</tt> </tt>
<a name="L224"></a><tt class="py-lineno">224</tt>  <tt class="py-line">    <tt class="py-name">result</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
<a name="L225"></a><tt class="py-lineno">225</tt>  <tt class="py-line">    <tt class="py-keyword">for</tt> <tt class="py-name">b</tt> <tt class="py-keyword">in</tt> <tt id="link-292" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-292', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-293" class="py-name"><a title="pyprocessing.globs.shape.bezierBlend" class="py-name" href="#" onclick="return doclink('link-293', 'bezierBlend', 'link-289');">bezierBlend</a></tt><tt class="py-op">:</tt> </tt>
<a name="L226"></a><tt class="py-lineno">226</tt>  <tt class="py-line">        <tt id="link-294" class="py-name"><a title="pyprocessing.globs.mouse.x
pyprocessing.globs.pmouse.x
pyprocessing.pvector.PVector.x" class="py-name" href="#" onclick="return doclink('link-294', 'x', 'link-19');">x</a></tt><tt class="py-op">,</tt><tt id="link-295" class="py-name"><a title="pyprocessing.globs.mouse.y
pyprocessing.globs.pmouse.y
pyprocessing.pvector.PVector.y" class="py-name" href="#" onclick="return doclink('link-295', 'y', 'link-20');">y</a></tt><tt class="py-op">,</tt><tt id="link-296" class="py-name"><a title="pyprocessing.pvector.PVector.z" class="py-name" href="#" onclick="return doclink('link-296', 'z', 'link-21');">z</a></tt> <tt class="py-op">=</tt> <tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-number">0</tt> </tt>
<a name="L227"></a><tt class="py-lineno">227</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt id="link-297" class="py-name" targets="Variable pyprocessing.pi=pyprocessing-module.html#pi,Variable pyprocessing.shapes.pi=pyprocessing.shapes-module.html#pi,Variable pyprocessing.transformations.pi=pyprocessing.transformations-module.html#pi"><a title="pyprocessing.pi
pyprocessing.shapes.pi
pyprocessing.transformations.pi" class="py-name" href="#" onclick="return doclink('link-297', 'pi', 'link-297');">pi</a></tt><tt class="py-op">,</tt><tt class="py-name">bi</tt> <tt class="py-keyword">in</tt> <tt class="py-name">zip</tt><tt class="py-op">(</tt><tt class="py-name">p</tt><tt class="py-op">,</tt><tt class="py-name">b</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L228"></a><tt class="py-lineno">228</tt>  <tt class="py-line">           <tt id="link-298" class="py-name"><a title="pyprocessing.globs.mouse.x
pyprocessing.globs.pmouse.x
pyprocessing.pvector.PVector.x" class="py-name" href="#" onclick="return doclink('link-298', 'x', 'link-19');">x</a></tt> <tt class="py-op">+=</tt> <tt id="link-299" class="py-name"><a title="pyprocessing.pi
pyprocessing.shapes.pi
pyprocessing.transformations.pi" class="py-name" href="#" onclick="return doclink('link-299', 'pi', 'link-297');">pi</a></tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">*</tt><tt class="py-name">bi</tt> </tt>
<a name="L229"></a><tt class="py-lineno">229</tt>  <tt class="py-line">           <tt id="link-300" class="py-name"><a title="pyprocessing.globs.mouse.y
pyprocessing.globs.pmouse.y
pyprocessing.pvector.PVector.y" class="py-name" href="#" onclick="return doclink('link-300', 'y', 'link-20');">y</a></tt> <tt class="py-op">+=</tt> <tt id="link-301" class="py-name"><a title="pyprocessing.pi
pyprocessing.shapes.pi
pyprocessing.transformations.pi" class="py-name" href="#" onclick="return doclink('link-301', 'pi', 'link-297');">pi</a></tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">*</tt><tt class="py-name">bi</tt> </tt>
<a name="L230"></a><tt class="py-lineno">230</tt>  <tt class="py-line">           <tt id="link-302" class="py-name"><a title="pyprocessing.pvector.PVector.z" class="py-name" href="#" onclick="return doclink('link-302', 'z', 'link-21');">z</a></tt> <tt class="py-op">+=</tt> <tt id="link-303" class="py-name"><a title="pyprocessing.pi
pyprocessing.shapes.pi
pyprocessing.transformations.pi" class="py-name" href="#" onclick="return doclink('link-303', 'pi', 'link-297');">pi</a></tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">*</tt><tt class="py-name">bi</tt> </tt>
<a name="L231"></a><tt class="py-lineno">231</tt>  <tt class="py-line">        <tt class="py-name">result</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-op">(</tt><tt id="link-304" class="py-name"><a title="pyprocessing.globs.mouse.x
pyprocessing.globs.pmouse.x
pyprocessing.pvector.PVector.x" class="py-name" href="#" onclick="return doclink('link-304', 'x', 'link-19');">x</a></tt><tt class="py-op">,</tt><tt id="link-305" class="py-name"><a title="pyprocessing.globs.mouse.y
pyprocessing.globs.pmouse.y
pyprocessing.pvector.PVector.y" class="py-name" href="#" onclick="return doclink('link-305', 'y', 'link-20');">y</a></tt><tt class="py-op">,</tt><tt id="link-306" class="py-name"><a title="pyprocessing.pvector.PVector.z" class="py-name" href="#" onclick="return doclink('link-306', 'z', 'link-21');">z</a></tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L232"></a><tt class="py-lineno">232</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">result</tt> </tt>
</div><a name="L233"></a><tt class="py-lineno">233</tt>  <tt class="py-line"> </tt>
<a name="bezier"></a><div id="bezier-def"><a name="L234"></a><tt class="py-lineno">234</tt> <a class="py-toggle" href="#" id="bezier-toggle" onclick="return toggle('bezier');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pyprocessing.shapes-module.html#bezier">bezier</a><tt class="py-op">(</tt><tt class="py-op">*</tt><tt class="py-param">coords</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="bezier-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="bezier-expanded"><a name="L235"></a><tt class="py-lineno">235</tt>  <tt class="py-line">    <tt class="py-docstring">"""Draws a cubic B&#233;zier curve for the 4 control points."""</tt> </tt>
<a name="L236"></a><tt class="py-lineno">236</tt>  <tt class="py-line">    <tt class="py-keyword">assert</tt> <tt class="py-op">(</tt><tt class="py-name">len</tt> <tt class="py-op">(</tt><tt class="py-name">coords</tt><tt class="py-op">)</tt> <tt class="py-keyword">in</tt> <tt class="py-op">(</tt><tt class="py-number">8</tt><tt class="py-op">,</tt><tt class="py-number">12</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L237"></a><tt class="py-lineno">237</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">coords</tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-number">8</tt><tt class="py-op">:</tt> </tt>
<a name="L238"></a><tt class="py-lineno">238</tt>  <tt class="py-line">        <tt class="py-name">ctrlpoints</tt> <tt class="py-op">=</tt> <tt class="py-name">coords</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">+</tt><tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-op">)</tt><tt class="py-op">+</tt><tt class="py-name">coords</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">:</tt><tt class="py-number">4</tt><tt class="py-op">]</tt><tt class="py-op">+</tt><tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-op">)</tt><tt class="py-op">+</tt><tt class="py-name">coords</tt><tt class="py-op">[</tt><tt class="py-number">4</tt><tt class="py-op">:</tt><tt class="py-number">6</tt><tt class="py-op">]</tt><tt class="py-op">+</tt><tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-op">)</tt><tt class="py-op">+</tt><tt class="py-name">coords</tt><tt class="py-op">[</tt><tt class="py-number">6</tt><tt class="py-op">:</tt><tt class="py-op">]</tt><tt class="py-op">+</tt><tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-op">)</tt> </tt>
<a name="L239"></a><tt class="py-lineno">239</tt>  <tt class="py-line">    <tt id="link-307" class="py-name" targets="Function pyprocessing.shapes.beginShape()=pyprocessing.shapes-module.html#beginShape"><a title="pyprocessing.shapes.beginShape" class="py-name" href="#" onclick="return doclink('link-307', 'beginShape', 'link-307');">beginShape</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L240"></a><tt class="py-lineno">240</tt>  <tt class="py-line">    <tt id="link-308" class="py-name" targets="Function pyprocessing.shapes.vertex()=pyprocessing.shapes-module.html#vertex"><a title="pyprocessing.shapes.vertex" class="py-name" href="#" onclick="return doclink('link-308', 'vertex', 'link-308');">vertex</a></tt> <tt class="py-op">(</tt><tt class="py-op">*</tt><tt class="py-name">ctrlpoints</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">:</tt><tt class="py-number">3</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L241"></a><tt class="py-lineno">241</tt>  <tt class="py-line">    <tt id="link-309" class="py-name" targets="Function pyprocessing.shapes.bezierVertex()=pyprocessing.shapes-module.html#bezierVertex"><a title="pyprocessing.shapes.bezierVertex" class="py-name" href="#" onclick="return doclink('link-309', 'bezierVertex', 'link-309');">bezierVertex</a></tt><tt class="py-op">(</tt><tt class="py-op">*</tt><tt class="py-name">ctrlpoints</tt><tt class="py-op">[</tt><tt class="py-number">3</tt><tt class="py-op">:</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L242"></a><tt class="py-lineno">242</tt>  <tt class="py-line">    <tt id="link-310" class="py-name" targets="Function pyprocessing.shapes.endShape()=pyprocessing.shapes-module.html#endShape"><a title="pyprocessing.shapes.endShape" class="py-name" href="#" onclick="return doclink('link-310', 'endShape', 'link-310');">endShape</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="L243"></a><tt class="py-lineno">243</tt>  <tt class="py-line"> </tt>
<a name="CatmullRomBlend"></a><div id="CatmullRomBlend-def"><a name="L244"></a><tt class="py-lineno">244</tt> <a class="py-toggle" href="#" id="CatmullRomBlend-toggle" onclick="return toggle('CatmullRomBlend');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="pyprocessing.shapes.CatmullRomBlend-class.html">CatmullRomBlend</a><tt class="py-op">:</tt> </tt>
</div><div id="CatmullRomBlend-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="CatmullRomBlend-expanded"><a name="L245"></a><tt class="py-lineno">245</tt>  <tt class="py-line">    <tt class="py-docstring">"""Cubic Catmull Rom Blending"""</tt> </tt>
<a name="L246"></a><tt class="py-lineno">246</tt>  <tt class="py-line">   </tt>
<a name="CatmullRomBlend.__init__"></a><div id="CatmullRomBlend.__init__-def"><a name="L247"></a><tt class="py-lineno">247</tt> <a class="py-toggle" href="#" id="CatmullRomBlend.__init__-toggle" onclick="return toggle('CatmullRomBlend.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyprocessing.shapes.CatmullRomBlend-class.html#__init__">__init__</a> <tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">tension</tt> <tt class="py-op">=</tt> <tt class="py-number">0.5</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="CatmullRomBlend.__init__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="CatmullRomBlend.__init__-expanded"><a name="L248"></a><tt class="py-lineno">248</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">tau</tt> <tt class="py-op">=</tt> <tt id="link-311" class="py-name" targets="Variable pyprocessing.globs.shape.tension=pyprocessing.globs.shape-class.html#tension"><a title="pyprocessing.globs.shape.tension" class="py-name" href="#" onclick="return doclink('link-311', 'tension', 'link-311');">tension</a></tt> </tt>
</div><a name="L249"></a><tt class="py-lineno">249</tt>  <tt class="py-line">         </tt>
<a name="CatmullRomBlend.blendFactors"></a><div id="CatmullRomBlend.blendFactors-def"><a name="L250"></a><tt class="py-lineno">250</tt> <a class="py-toggle" href="#" id="CatmullRomBlend.blendFactors-toggle" onclick="return toggle('CatmullRomBlend.blendFactors');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyprocessing.shapes.CatmullRomBlend-class.html#blendFactors">blendFactors</a> <tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">u</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="CatmullRomBlend.blendFactors-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="CatmullRomBlend.blendFactors-expanded"><a name="L251"></a><tt class="py-lineno">251</tt>  <tt class="py-line">        <tt class="py-docstring">"""Given a value for u, returns the blending factors for each</tt> </tt>
<a name="L252"></a><tt class="py-lineno">252</tt>  <tt class="py-line"><tt class="py-docstring">        of the 4 control points."""</tt> </tt>
<a name="L253"></a><tt class="py-lineno">253</tt>  <tt class="py-line">        <tt class="py-name">u2</tt> <tt class="py-op">=</tt> <tt class="py-name">u</tt><tt class="py-op">*</tt><tt class="py-name">u</tt> </tt>
<a name="L254"></a><tt class="py-lineno">254</tt>  <tt class="py-line">        <tt class="py-name">u3</tt> <tt class="py-op">=</tt> <tt class="py-name">u2</tt><tt class="py-op">*</tt><tt class="py-name">u</tt> </tt>
<a name="L255"></a><tt class="py-lineno">255</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-op">[</tt> </tt>
<a name="L256"></a><tt class="py-lineno">256</tt>  <tt class="py-line">             <tt class="py-op">-</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">tau</tt> <tt class="py-op">*</tt> <tt class="py-name">u</tt> <tt class="py-op">+</tt> <tt class="py-number">2</tt> <tt class="py-op">*</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">tau</tt> <tt class="py-op">*</tt> <tt class="py-name">u2</tt> <tt class="py-op">-</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">tau</tt> <tt class="py-op">*</tt> <tt class="py-name">u3</tt><tt class="py-op">,</tt> </tt>
<a name="L257"></a><tt class="py-lineno">257</tt>  <tt class="py-line">             <tt class="py-number">1</tt> <tt class="py-op">+</tt> <tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">tau</tt><tt class="py-op">-</tt><tt class="py-number">3</tt><tt class="py-op">)</tt> <tt class="py-op">*</tt> <tt class="py-name">u2</tt> <tt class="py-op">+</tt> <tt class="py-op">(</tt><tt class="py-number">2</tt> <tt class="py-op">-</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">tau</tt><tt class="py-op">)</tt> <tt class="py-op">*</tt> <tt class="py-name">u3</tt><tt class="py-op">,</tt> </tt>
<a name="L258"></a><tt class="py-lineno">258</tt>  <tt class="py-line">             <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">tau</tt> <tt class="py-op">*</tt> <tt class="py-name">u</tt> <tt class="py-op">+</tt> <tt class="py-op">(</tt><tt class="py-number">3</tt> <tt class="py-op">-</tt> <tt class="py-number">2</tt><tt class="py-op">*</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">tau</tt><tt class="py-op">)</tt> <tt class="py-op">*</tt> <tt class="py-name">u2</tt> <tt class="py-op">+</tt> <tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">tau</tt> <tt class="py-op">-</tt> <tt class="py-number">2</tt><tt class="py-op">)</tt> <tt class="py-op">*</tt> <tt class="py-name">u3</tt><tt class="py-op">,</tt> </tt>
<a name="L259"></a><tt class="py-lineno">259</tt>  <tt class="py-line">             <tt class="py-op">-</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">tau</tt> <tt class="py-op">*</tt> <tt class="py-name">u2</tt> <tt class="py-op">+</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">tau</tt> <tt class="py-op">*</tt> <tt class="py-name">u3</tt><tt class="py-op">]</tt> </tt>
</div><a name="L260"></a><tt class="py-lineno">260</tt>  <tt class="py-line"> </tt>
<a name="CatmullRomBlend.tangentBlendFactors"></a><div id="CatmullRomBlend.tangentBlendFactors-def"><a name="L261"></a><tt class="py-lineno">261</tt> <a class="py-toggle" href="#" id="CatmullRomBlend.tangentBlendFactors-toggle" onclick="return toggle('CatmullRomBlend.tangentBlendFactors');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyprocessing.shapes.CatmullRomBlend-class.html#tangentBlendFactors">tangentBlendFactors</a> <tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">u</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="CatmullRomBlend.tangentBlendFactors-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="CatmullRomBlend.tangentBlendFactors-expanded"><a name="L262"></a><tt class="py-lineno">262</tt>  <tt class="py-line">        <tt class="py-docstring">"""Given a value for u, returns the tangent blending factors for each</tt> </tt>
<a name="L263"></a><tt class="py-lineno">263</tt>  <tt class="py-line"><tt class="py-docstring">        of the 4 control points."""</tt> </tt>
<a name="L264"></a><tt class="py-lineno">264</tt>  <tt class="py-line">        <tt class="py-name">u2</tt> <tt class="py-op">=</tt> <tt class="py-name">u</tt><tt class="py-op">*</tt><tt class="py-name">u</tt> </tt>
<a name="L265"></a><tt class="py-lineno">265</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-op">[</tt> </tt>
<a name="L266"></a><tt class="py-lineno">266</tt>  <tt class="py-line">             <tt class="py-op">-</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">tau</tt> <tt class="py-op">+</tt> <tt class="py-number">4</tt> <tt class="py-op">*</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">tau</tt> <tt class="py-op">*</tt> <tt class="py-name">u</tt> <tt class="py-op">-</tt> <tt class="py-number">3</tt> <tt class="py-op">*</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">tau</tt> <tt class="py-op">*</tt> <tt class="py-name">u2</tt><tt class="py-op">,</tt> </tt>
<a name="L267"></a><tt class="py-lineno">267</tt>  <tt class="py-line">             <tt class="py-op">(</tt><tt class="py-number">2</tt><tt class="py-op">*</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">tau</tt><tt class="py-op">-</tt><tt class="py-number">6</tt><tt class="py-op">)</tt> <tt class="py-op">*</tt> <tt class="py-name">u</tt> <tt class="py-op">+</tt> <tt class="py-op">(</tt><tt class="py-number">6</tt> <tt class="py-op">-</tt> <tt class="py-number">3</tt><tt class="py-op">*</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">tau</tt><tt class="py-op">)</tt> <tt class="py-op">*</tt> <tt class="py-name">u2</tt><tt class="py-op">,</tt> </tt>
<a name="L268"></a><tt class="py-lineno">268</tt>  <tt class="py-line">             <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">tau</tt> <tt class="py-op">+</tt> <tt class="py-op">(</tt><tt class="py-number">6</tt> <tt class="py-op">-</tt> <tt class="py-number">4</tt><tt class="py-op">*</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">tau</tt><tt class="py-op">)</tt> <tt class="py-op">*</tt> <tt class="py-name">u</tt> <tt class="py-op">+</tt> <tt class="py-op">(</tt><tt class="py-number">3</tt><tt class="py-op">*</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">tau</tt> <tt class="py-op">-</tt> <tt class="py-number">6</tt><tt class="py-op">)</tt> <tt class="py-op">*</tt> <tt class="py-name">u2</tt><tt class="py-op">,</tt> </tt>
<a name="L269"></a><tt class="py-lineno">269</tt>  <tt class="py-line">             <tt class="py-op">-</tt><tt class="py-number">2</tt><tt class="py-op">*</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">tau</tt> <tt class="py-op">*</tt> <tt class="py-name">u</tt> <tt class="py-op">+</tt> <tt class="py-number">3</tt><tt class="py-op">*</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">tau</tt> <tt class="py-op">*</tt> <tt class="py-name">u2</tt><tt class="py-op">]</tt> </tt>
</div><a name="L270"></a><tt class="py-lineno">270</tt>  <tt class="py-line">     </tt>
<a name="L271"></a><tt class="py-lineno">271</tt>  <tt class="py-line">   </tt>
<a name="CatmullRomBlend.blendPoint"></a><div id="CatmullRomBlend.blendPoint-def"><a name="L272"></a><tt class="py-lineno">272</tt> <a class="py-toggle" href="#" id="CatmullRomBlend.blendPoint-toggle" onclick="return toggle('CatmullRomBlend.blendPoint');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyprocessing.shapes.CatmullRomBlend-class.html#blendPoint">blendPoint</a> <tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">u</tt><tt class="py-op">,</tt> <tt class="py-param">p0</tt><tt class="py-op">,</tt> <tt class="py-param">p1</tt><tt class="py-op">,</tt> <tt class="py-param">p2</tt><tt class="py-op">,</tt> <tt class="py-param">p3</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="CatmullRomBlend.blendPoint-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="CatmullRomBlend.blendPoint-expanded"><a name="L273"></a><tt class="py-lineno">273</tt>  <tt class="py-line">        <tt class="py-docstring">"""Returns the point obtained by blending pi with factor u."""</tt> </tt>
<a name="L274"></a><tt class="py-lineno">274</tt>  <tt class="py-line">        <tt class="py-name">result</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> </tt>
<a name="L275"></a><tt class="py-lineno">275</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">b</tt><tt class="py-op">,</tt><tt class="py-name">p</tt> <tt class="py-keyword">in</tt> <tt class="py-name">zip</tt> <tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-312" class="py-name" targets="Method pyprocessing.shapes.CatmullRomBlend.blendFactors()=pyprocessing.shapes.CatmullRomBlend-class.html#blendFactors"><a title="pyprocessing.shapes.CatmullRomBlend.blendFactors" class="py-name" href="#" onclick="return doclink('link-312', 'blendFactors', 'link-312');">blendFactors</a></tt><tt class="py-op">(</tt><tt class="py-name">u</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-op">(</tt><tt class="py-name">p0</tt><tt class="py-op">,</tt><tt class="py-name">p1</tt><tt class="py-op">,</tt><tt class="py-name">p2</tt><tt class="py-op">,</tt><tt class="py-name">p3</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L276"></a><tt class="py-lineno">276</tt>  <tt class="py-line">            <tt class="py-keyword">for</tt> <tt class="py-name">i</tt><tt class="py-op">,</tt><tt id="link-313" class="py-name"><a title="pyprocessing.globs.mouse.x
pyprocessing.globs.pmouse.x
pyprocessing.pvector.PVector.x" class="py-name" href="#" onclick="return doclink('link-313', 'x', 'link-19');">x</a></tt> <tt class="py-keyword">in</tt> <tt class="py-name">enumerate</tt><tt class="py-op">(</tt><tt class="py-name">p</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L277"></a><tt class="py-lineno">277</tt>  <tt class="py-line">                <tt class="py-name">result</tt><tt class="py-op">[</tt><tt class="py-name">i</tt><tt class="py-op">]</tt> <tt class="py-op">+=</tt> <tt class="py-name">p</tt><tt class="py-op">[</tt><tt class="py-name">i</tt><tt class="py-op">]</tt><tt class="py-op">*</tt><tt class="py-name">b</tt> </tt>
<a name="L278"></a><tt class="py-lineno">278</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">result</tt> </tt>
</div><a name="L279"></a><tt class="py-lineno">279</tt>  <tt class="py-line">         </tt>
<a name="CatmullRomBlend.blendTangent"></a><div id="CatmullRomBlend.blendTangent-def"><a name="L280"></a><tt class="py-lineno">280</tt> <a class="py-toggle" href="#" id="CatmullRomBlend.blendTangent-toggle" onclick="return toggle('CatmullRomBlend.blendTangent');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyprocessing.shapes.CatmullRomBlend-class.html#blendTangent">blendTangent</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">u</tt><tt class="py-op">,</tt> <tt class="py-param">p0</tt><tt class="py-op">,</tt> <tt class="py-param">p1</tt><tt class="py-op">,</tt> <tt class="py-param">p2</tt><tt class="py-op">,</tt> <tt class="py-param">p3</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="CatmullRomBlend.blendTangent-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="CatmullRomBlend.blendTangent-expanded"><a name="L281"></a><tt class="py-lineno">281</tt>  <tt class="py-line">        <tt class="py-docstring">"""Returns the curve tangent at the point obtained by blending pi with factor u."""</tt> </tt>
<a name="L282"></a><tt class="py-lineno">282</tt>  <tt class="py-line">        <tt class="py-name">result</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> </tt>
<a name="L283"></a><tt class="py-lineno">283</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">b</tt><tt class="py-op">,</tt><tt class="py-name">p</tt> <tt class="py-keyword">in</tt> <tt class="py-name">zip</tt> <tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-314" class="py-name" targets="Method pyprocessing.shapes.CatmullRomBlend.tangentBlendFactors()=pyprocessing.shapes.CatmullRomBlend-class.html#tangentBlendFactors"><a title="pyprocessing.shapes.CatmullRomBlend.tangentBlendFactors" class="py-name" href="#" onclick="return doclink('link-314', 'tangentBlendFactors', 'link-314');">tangentBlendFactors</a></tt><tt class="py-op">(</tt><tt class="py-name">u</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-op">(</tt><tt class="py-name">p0</tt><tt class="py-op">,</tt><tt class="py-name">p1</tt><tt class="py-op">,</tt><tt class="py-name">p2</tt><tt class="py-op">,</tt><tt class="py-name">p3</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L284"></a><tt class="py-lineno">284</tt>  <tt class="py-line">            <tt class="py-keyword">for</tt> <tt class="py-name">i</tt><tt class="py-op">,</tt><tt id="link-315" class="py-name"><a title="pyprocessing.globs.mouse.x
pyprocessing.globs.pmouse.x
pyprocessing.pvector.PVector.x" class="py-name" href="#" onclick="return doclink('link-315', 'x', 'link-19');">x</a></tt> <tt class="py-keyword">in</tt> <tt class="py-name">enumerate</tt><tt class="py-op">(</tt><tt class="py-name">p</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L285"></a><tt class="py-lineno">285</tt>  <tt class="py-line">                <tt class="py-name">result</tt><tt class="py-op">[</tt><tt class="py-name">i</tt><tt class="py-op">]</tt> <tt class="py-op">+=</tt> <tt class="py-name">p</tt><tt class="py-op">[</tt><tt class="py-name">i</tt><tt class="py-op">]</tt><tt class="py-op">*</tt><tt class="py-name">b</tt> </tt>
<a name="L286"></a><tt class="py-lineno">286</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">result</tt> </tt>
</div></div><a name="L287"></a><tt class="py-lineno">287</tt>  <tt class="py-line">     </tt>
<a name="curveTightness"></a><div id="curveTightness-def"><a name="L288"></a><tt class="py-lineno">288</tt> <a class="py-toggle" href="#" id="curveTightness-toggle" onclick="return toggle('curveTightness');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pyprocessing.shapes-module.html#curveTightness">curveTightness</a> <tt class="py-op">(</tt><tt class="py-param">squishy</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="curveTightness-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="curveTightness-expanded"><a name="L289"></a><tt class="py-lineno">289</tt>  <tt class="py-line">    <tt class="py-docstring">"""Uses 'squishy' as the tension factor for the catmull-rom spline."""</tt> </tt>
<a name="L290"></a><tt class="py-lineno">290</tt>  <tt class="py-line">    <tt id="link-316" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-316', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-317" class="py-name"><a title="pyprocessing.globs.shape.tension" class="py-name" href="#" onclick="return doclink('link-317', 'tension', 'link-311');">tension</a></tt> <tt class="py-op">=</tt> <tt class="py-op">(</tt><tt class="py-number">1</tt><tt class="py-op">-</tt><tt class="py-name">squishy</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-number">2.0</tt> </tt>
</div><a name="L291"></a><tt class="py-lineno">291</tt>  <tt class="py-line">     </tt>
<a name="curveVertex"></a><div id="curveVertex-def"><a name="L292"></a><tt class="py-lineno">292</tt> <a class="py-toggle" href="#" id="curveVertex-toggle" onclick="return toggle('curveVertex');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pyprocessing.shapes-module.html#curveVertex">curveVertex</a><tt class="py-op">(</tt><tt class="py-param">x</tt><tt class="py-op">,</tt><tt class="py-param">y</tt><tt class="py-op">,</tt><tt class="py-param">z</tt><tt class="py-op">=</tt><tt class="py-number">0</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="curveVertex-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="curveVertex-expanded"><a name="L293"></a><tt class="py-lineno">293</tt>  <tt class="py-line">    <tt class="py-docstring">"""Generates a cubic Catmull-Rom curve corresponding to interpolating</tt> </tt>
<a name="L294"></a><tt class="py-lineno">294</tt>  <tt class="py-line"><tt class="py-docstring">    the three last points issued with earlier calls to curveVertex and this one.</tt> </tt>
<a name="L295"></a><tt class="py-lineno">295</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="L296"></a><tt class="py-lineno">296</tt>  <tt class="py-line">    <tt id="link-318" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-318', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt class="py-name">crv</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-op">(</tt><tt id="link-319" class="py-name"><a title="pyprocessing.globs.mouse.x
pyprocessing.globs.pmouse.x
pyprocessing.pvector.PVector.x" class="py-name" href="#" onclick="return doclink('link-319', 'x', 'link-19');">x</a></tt><tt class="py-op">,</tt><tt id="link-320" class="py-name"><a title="pyprocessing.globs.mouse.y
pyprocessing.globs.pmouse.y
pyprocessing.pvector.PVector.y" class="py-name" href="#" onclick="return doclink('link-320', 'y', 'link-20');">y</a></tt><tt class="py-op">,</tt><tt id="link-321" class="py-name"><a title="pyprocessing.pvector.PVector.z" class="py-name" href="#" onclick="return doclink('link-321', 'z', 'link-21');">z</a></tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L297"></a><tt class="py-lineno">297</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt id="link-322" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-322', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt class="py-name">crv</tt><tt class="py-op">)</tt><tt class="py-op">&gt;</tt><tt class="py-number">4</tt><tt class="py-op">:</tt> <tt id="link-323" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-323', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt class="py-name">crv</tt> <tt class="py-op">=</tt> <tt id="link-324" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-324', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt class="py-name">crv</tt><tt class="py-op">[</tt><tt class="py-op">-</tt><tt class="py-number">4</tt><tt class="py-op">:</tt><tt class="py-op">]</tt> </tt>
<a name="L298"></a><tt class="py-lineno">298</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt id="link-325" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-325', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt class="py-name">crv</tt><tt class="py-op">)</tt><tt class="py-op">==</tt><tt class="py-number">4</tt><tt class="py-op">:</tt> </tt>
<a name="L299"></a><tt class="py-lineno">299</tt>  <tt class="py-line">        <tt id="link-326" class="py-name" targets="Function pyprocessing.pimage.blend()=pyprocessing.pimage-module.html#blend"><a title="pyprocessing.pimage.blend" class="py-name" href="#" onclick="return doclink('link-326', 'blend', 'link-326');">blend</a></tt> <tt class="py-op">=</tt> <tt id="link-327" class="py-name" targets="Class pyprocessing.shapes.CatmullRomBlend=pyprocessing.shapes.CatmullRomBlend-class.html"><a title="pyprocessing.shapes.CatmullRomBlend" class="py-name" href="#" onclick="return doclink('link-327', 'CatmullRomBlend', 'link-327');">CatmullRomBlend</a></tt><tt class="py-op">(</tt><tt id="link-328" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-328', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-329" class="py-name"><a title="pyprocessing.globs.shape.tension" class="py-name" href="#" onclick="return doclink('link-329', 'tension', 'link-311');">tension</a></tt><tt class="py-op">)</tt> </tt>
<a name="L300"></a><tt class="py-lineno">300</tt>  <tt class="py-line">        <tt class="py-name">npts</tt> <tt class="py-op">=</tt> <tt id="link-330" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-330', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-331" class="py-name" targets="Variable pyprocessing.globs.shape.curveDetail=pyprocessing.globs.shape-class.html#curveDetail,Function pyprocessing.shapes.curveDetail()=pyprocessing.shapes-module.html#curveDetail"><a title="pyprocessing.globs.shape.curveDetail
pyprocessing.shapes.curveDetail" class="py-name" href="#" onclick="return doclink('link-331', 'curveDetail', 'link-331');">curveDetail</a></tt> </tt>
<a name="L301"></a><tt class="py-lineno">301</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">i</tt> <tt class="py-keyword">in</tt> <tt class="py-name">range</tt><tt class="py-op">(</tt><tt class="py-name">npts</tt><tt class="py-op">+</tt><tt class="py-number">1</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L302"></a><tt class="py-lineno">302</tt>  <tt class="py-line">            <tt class="py-name">p</tt> <tt class="py-op">=</tt> <tt id="link-332" class="py-name"><a title="pyprocessing.pimage.blend" class="py-name" href="#" onclick="return doclink('link-332', 'blend', 'link-326');">blend</a></tt><tt class="py-op">.</tt><tt id="link-333" class="py-name" targets="Method pyprocessing.shapes.CatmullRomBlend.blendPoint()=pyprocessing.shapes.CatmullRomBlend-class.html#blendPoint"><a title="pyprocessing.shapes.CatmullRomBlend.blendPoint" class="py-name" href="#" onclick="return doclink('link-333', 'blendPoint', 'link-333');">blendPoint</a></tt><tt class="py-op">(</tt><tt class="py-name">float</tt><tt class="py-op">(</tt><tt class="py-name">i</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-name">npts</tt><tt class="py-op">,</tt> <tt class="py-op">*</tt><tt id="link-334" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-334', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt class="py-name">crv</tt><tt class="py-op">)</tt> </tt>
<a name="L303"></a><tt class="py-lineno">303</tt>  <tt class="py-line">            <tt id="link-335" class="py-name"><a title="pyprocessing.shapes.vertex" class="py-name" href="#" onclick="return doclink('link-335', 'vertex', 'link-308');">vertex</a></tt><tt class="py-op">(</tt><tt class="py-op">*</tt><tt class="py-name">p</tt><tt class="py-op">)</tt> </tt>
</div><a name="L304"></a><tt class="py-lineno">304</tt>  <tt class="py-line">             </tt>
<a name="curve"></a><div id="curve-def"><a name="L305"></a><tt class="py-lineno">305</tt> <a class="py-toggle" href="#" id="curve-toggle" onclick="return toggle('curve');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pyprocessing.shapes-module.html#curve">curve</a> <tt class="py-op">(</tt><tt class="py-op">*</tt><tt class="py-param">coords</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="curve-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="curve-expanded"><a name="L306"></a><tt class="py-lineno">306</tt>  <tt class="py-line">    <tt class="py-docstring">"""Generates a catmull-rom curve given 4 points. Takes either 8 numbers </tt> </tt>
<a name="L307"></a><tt class="py-lineno">307</tt>  <tt class="py-line"><tt class="py-docstring">    for coordinates of 4 points in 2D or 12 numbers for 4 points in 3D"""</tt> </tt>
<a name="L308"></a><tt class="py-lineno">308</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">coords</tt><tt class="py-op">)</tt><tt class="py-op">==</tt><tt class="py-number">8</tt><tt class="py-op">:</tt> </tt>
<a name="L309"></a><tt class="py-lineno">309</tt>  <tt class="py-line">        <tt class="py-name">p0</tt><tt class="py-op">,</tt><tt class="py-name">p1</tt><tt class="py-op">,</tt><tt class="py-name">p2</tt><tt class="py-op">,</tt><tt class="py-name">p3</tt> <tt class="py-op">=</tt> <tt class="py-name">coords</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">:</tt><tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">coords</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">:</tt><tt class="py-number">4</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">coords</tt><tt class="py-op">[</tt><tt class="py-number">4</tt><tt class="py-op">:</tt><tt class="py-number">6</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">coords</tt><tt class="py-op">[</tt><tt class="py-number">6</tt><tt class="py-op">:</tt><tt class="py-number">8</tt><tt class="py-op">]</tt> </tt>
<a name="L310"></a><tt class="py-lineno">310</tt>  <tt class="py-line">    <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L311"></a><tt class="py-lineno">311</tt>  <tt class="py-line">        <tt class="py-keyword">assert</tt> <tt class="py-op">(</tt><tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">coords</tt><tt class="py-op">)</tt><tt class="py-op">==</tt><tt class="py-number">12</tt><tt class="py-op">)</tt> </tt>
<a name="L312"></a><tt class="py-lineno">312</tt>  <tt class="py-line">        <tt class="py-name">p0</tt><tt class="py-op">,</tt><tt class="py-name">p1</tt><tt class="py-op">,</tt><tt class="py-name">p2</tt><tt class="py-op">,</tt><tt class="py-name">p3</tt> <tt class="py-op">=</tt> <tt class="py-name">coords</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">:</tt><tt class="py-number">3</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">coords</tt><tt class="py-op">[</tt><tt class="py-number">3</tt><tt class="py-op">:</tt><tt class="py-number">6</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">coords</tt><tt class="py-op">[</tt><tt class="py-number">6</tt><tt class="py-op">:</tt><tt class="py-number">9</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">coords</tt><tt class="py-op">[</tt><tt class="py-number">9</tt><tt class="py-op">:</tt><tt class="py-number">12</tt><tt class="py-op">]</tt> </tt>
<a name="L313"></a><tt class="py-lineno">313</tt>  <tt class="py-line">    <tt id="link-336" class="py-name"><a title="pyprocessing.pimage.blend" class="py-name" href="#" onclick="return doclink('link-336', 'blend', 'link-326');">blend</a></tt> <tt class="py-op">=</tt> <tt id="link-337" class="py-name"><a title="pyprocessing.shapes.CatmullRomBlend" class="py-name" href="#" onclick="return doclink('link-337', 'CatmullRomBlend', 'link-327');">CatmullRomBlend</a></tt><tt class="py-op">(</tt><tt id="link-338" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-338', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-339" class="py-name"><a title="pyprocessing.globs.shape.tension" class="py-name" href="#" onclick="return doclink('link-339', 'tension', 'link-311');">tension</a></tt><tt class="py-op">)</tt> </tt>
<a name="L314"></a><tt class="py-lineno">314</tt>  <tt class="py-line">    <tt id="link-340" class="py-name"><a title="pyprocessing.shapes.beginShape" class="py-name" href="#" onclick="return doclink('link-340', 'beginShape', 'link-307');">beginShape</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L315"></a><tt class="py-lineno">315</tt>  <tt class="py-line">    <tt class="py-name">npts</tt> <tt class="py-op">=</tt> <tt id="link-341" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-341', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-342" class="py-name"><a title="pyprocessing.globs.shape.curveDetail
pyprocessing.shapes.curveDetail" class="py-name" href="#" onclick="return doclink('link-342', 'curveDetail', 'link-331');">curveDetail</a></tt> </tt>
<a name="L316"></a><tt class="py-lineno">316</tt>  <tt class="py-line">    <tt class="py-keyword">for</tt> <tt class="py-name">i</tt> <tt class="py-keyword">in</tt> <tt class="py-name">range</tt><tt class="py-op">(</tt><tt class="py-name">npts</tt><tt class="py-op">+</tt><tt class="py-number">1</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L317"></a><tt class="py-lineno">317</tt>  <tt class="py-line">        <tt class="py-name">p</tt> <tt class="py-op">=</tt> <tt id="link-343" class="py-name"><a title="pyprocessing.pimage.blend" class="py-name" href="#" onclick="return doclink('link-343', 'blend', 'link-326');">blend</a></tt><tt class="py-op">.</tt><tt id="link-344" class="py-name"><a title="pyprocessing.shapes.CatmullRomBlend.blendPoint" class="py-name" href="#" onclick="return doclink('link-344', 'blendPoint', 'link-333');">blendPoint</a></tt><tt class="py-op">(</tt><tt class="py-name">float</tt><tt class="py-op">(</tt><tt class="py-name">i</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-name">npts</tt><tt class="py-op">,</tt> <tt class="py-name">p0</tt><tt class="py-op">,</tt><tt class="py-name">p1</tt><tt class="py-op">,</tt><tt class="py-name">p2</tt><tt class="py-op">,</tt><tt class="py-name">p3</tt><tt class="py-op">)</tt> </tt>
<a name="L318"></a><tt class="py-lineno">318</tt>  <tt class="py-line">        <tt id="link-345" class="py-name"><a title="pyprocessing.shapes.vertex" class="py-name" href="#" onclick="return doclink('link-345', 'vertex', 'link-308');">vertex</a></tt><tt class="py-op">(</tt><tt class="py-op">*</tt><tt class="py-name">p</tt><tt class="py-op">)</tt> </tt>
<a name="L319"></a><tt class="py-lineno">319</tt>  <tt class="py-line">    <tt id="link-346" class="py-name"><a title="pyprocessing.shapes.endShape" class="py-name" href="#" onclick="return doclink('link-346', 'endShape', 'link-310');">endShape</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="L320"></a><tt class="py-lineno">320</tt>  <tt class="py-line"> </tt>
<a name="curvePoint"></a><div id="curvePoint-def"><a name="L321"></a><tt class="py-lineno">321</tt> <a class="py-toggle" href="#" id="curvePoint-toggle" onclick="return toggle('curvePoint');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pyprocessing.shapes-module.html#curvePoint">curvePoint</a> <tt class="py-op">(</tt><tt class="py-param">a</tt><tt class="py-op">,</tt><tt class="py-param">b</tt><tt class="py-op">,</tt><tt class="py-param">c</tt><tt class="py-op">,</tt><tt class="py-param">d</tt><tt class="py-op">,</tt><tt class="py-param">t</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="curvePoint-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="curvePoint-expanded"><a name="L322"></a><tt class="py-lineno">322</tt>  <tt class="py-line">    <tt class="py-docstring">"""Evaluates the n'th coordinate of a cubic Catmull-Rom curve at parameter</tt> </tt>
<a name="L323"></a><tt class="py-lineno">323</tt>  <tt class="py-line"><tt class="py-docstring">    t for control points having their n'th coordinate equal to a, b, c and d, respectively.</tt> </tt>
<a name="L324"></a><tt class="py-lineno">324</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="L325"></a><tt class="py-lineno">325</tt>  <tt class="py-line">    <tt id="link-347" class="py-name"><a title="pyprocessing.pimage.blend" class="py-name" href="#" onclick="return doclink('link-347', 'blend', 'link-326');">blend</a></tt> <tt class="py-op">=</tt> <tt id="link-348" class="py-name"><a title="pyprocessing.shapes.CatmullRomBlend" class="py-name" href="#" onclick="return doclink('link-348', 'CatmullRomBlend', 'link-327');">CatmullRomBlend</a></tt><tt class="py-op">(</tt><tt id="link-349" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-349', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-350" class="py-name"><a title="pyprocessing.globs.shape.tension" class="py-name" href="#" onclick="return doclink('link-350', 'tension', 'link-311');">tension</a></tt><tt class="py-op">)</tt> </tt>
<a name="L326"></a><tt class="py-lineno">326</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt id="link-351" class="py-name"><a title="pyprocessing.pimage.blend" class="py-name" href="#" onclick="return doclink('link-351', 'blend', 'link-326');">blend</a></tt><tt class="py-op">.</tt><tt id="link-352" class="py-name"><a title="pyprocessing.shapes.CatmullRomBlend.blendPoint" class="py-name" href="#" onclick="return doclink('link-352', 'blendPoint', 'link-333');">blendPoint</a></tt><tt class="py-op">(</tt><tt class="py-name">t</tt><tt class="py-op">,</tt><tt class="py-op">(</tt><tt class="py-name">a</tt><tt class="py-op">,</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-op">(</tt><tt class="py-name">b</tt><tt class="py-op">,</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-op">(</tt><tt class="py-name">c</tt><tt class="py-op">,</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-op">(</tt><tt class="py-name">d</tt><tt class="py-op">,</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> <tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> </tt>
</div><a name="L327"></a><tt class="py-lineno">327</tt>  <tt class="py-line"> </tt>
<a name="curveTangent"></a><div id="curveTangent-def"><a name="L328"></a><tt class="py-lineno">328</tt> <a class="py-toggle" href="#" id="curveTangent-toggle" onclick="return toggle('curveTangent');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pyprocessing.shapes-module.html#curveTangent">curveTangent</a> <tt class="py-op">(</tt><tt class="py-param">a</tt><tt class="py-op">,</tt><tt class="py-param">b</tt><tt class="py-op">,</tt><tt class="py-param">c</tt><tt class="py-op">,</tt><tt class="py-param">d</tt><tt class="py-op">,</tt><tt class="py-param">t</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="curveTangent-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="curveTangent-expanded"><a name="L329"></a><tt class="py-lineno">329</tt>  <tt class="py-line">    <tt class="py-docstring">"""Evaluates the n'th coordinate of the tangent at the point on a cubic Catmull-Rom </tt> </tt>
<a name="L330"></a><tt class="py-lineno">330</tt>  <tt class="py-line"><tt class="py-docstring">    curve at parameter t for control points having their n'th coordinate equal to </tt> </tt>
<a name="L331"></a><tt class="py-lineno">331</tt>  <tt class="py-line"><tt class="py-docstring">    a, b, c and d, respectively.</tt> </tt>
<a name="L332"></a><tt class="py-lineno">332</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="L333"></a><tt class="py-lineno">333</tt>  <tt class="py-line">    <tt id="link-353" class="py-name"><a title="pyprocessing.pimage.blend" class="py-name" href="#" onclick="return doclink('link-353', 'blend', 'link-326');">blend</a></tt> <tt class="py-op">=</tt> <tt id="link-354" class="py-name"><a title="pyprocessing.shapes.CatmullRomBlend" class="py-name" href="#" onclick="return doclink('link-354', 'CatmullRomBlend', 'link-327');">CatmullRomBlend</a></tt><tt class="py-op">(</tt><tt id="link-355" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-355', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-356" class="py-name"><a title="pyprocessing.globs.shape.tension" class="py-name" href="#" onclick="return doclink('link-356', 'tension', 'link-311');">tension</a></tt><tt class="py-op">)</tt> </tt>
<a name="L334"></a><tt class="py-lineno">334</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt id="link-357" class="py-name"><a title="pyprocessing.pimage.blend" class="py-name" href="#" onclick="return doclink('link-357', 'blend', 'link-326');">blend</a></tt><tt class="py-op">.</tt><tt id="link-358" class="py-name" targets="Method pyprocessing.shapes.CatmullRomBlend.blendTangent()=pyprocessing.shapes.CatmullRomBlend-class.html#blendTangent"><a title="pyprocessing.shapes.CatmullRomBlend.blendTangent" class="py-name" href="#" onclick="return doclink('link-358', 'blendTangent', 'link-358');">blendTangent</a></tt><tt class="py-op">(</tt><tt class="py-name">t</tt><tt class="py-op">,</tt><tt class="py-op">(</tt><tt class="py-name">a</tt><tt class="py-op">,</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-op">(</tt><tt class="py-name">b</tt><tt class="py-op">,</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-op">(</tt><tt class="py-name">c</tt><tt class="py-op">,</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-op">(</tt><tt class="py-name">d</tt><tt class="py-op">,</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> <tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> </tt>
</div><a name="L335"></a><tt class="py-lineno">335</tt>  <tt class="py-line">     </tt>
<a name="curveDetail"></a><div id="curveDetail-def"><a name="L336"></a><tt class="py-lineno">336</tt> <a class="py-toggle" href="#" id="curveDetail-toggle" onclick="return toggle('curveDetail');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pyprocessing.shapes-module.html#curveDetail">curveDetail</a><tt class="py-op">(</tt><tt class="py-param">npts</tt><tt class="py-op">=</tt><tt id="link-359" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-359', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-360" class="py-name"><a title="pyprocessing.globs.shape.curveDetail
pyprocessing.shapes.curveDetail" class="py-name" href="#" onclick="return doclink('link-360', 'curveDetail', 'link-331');">curveDetail</a></tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="curveDetail-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="curveDetail-expanded"><a name="L337"></a><tt class="py-lineno">337</tt>  <tt class="py-line">    <tt class="py-docstring">"""Controls the number of samples per curve arc."""</tt> </tt>
<a name="L338"></a><tt class="py-lineno">338</tt>  <tt class="py-line">    <tt id="link-361" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-361', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-362" class="py-name"><a title="pyprocessing.globs.shape.curveDetail
pyprocessing.shapes.curveDetail" class="py-name" href="#" onclick="return doclink('link-362', 'curveDetail', 'link-331');">curveDetail</a></tt> <tt class="py-op">=</tt> <tt class="py-name">npts</tt> </tt>
</div><a name="L339"></a><tt class="py-lineno">339</tt>  <tt class="py-line"> </tt>
<a name="sphereDetail"></a><div id="sphereDetail-def"><a name="L340"></a><tt class="py-lineno">340</tt> <a class="py-toggle" href="#" id="sphereDetail-toggle" onclick="return toggle('sphereDetail');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pyprocessing.shapes-module.html#sphereDetail">sphereDetail</a><tt class="py-op">(</tt><tt class="py-op">*</tt><tt class="py-param">args</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="sphereDetail-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="sphereDetail-expanded"><a name="L341"></a><tt class="py-lineno">341</tt>  <tt class="py-line">    <tt class="py-docstring">"""Controls the how many segments are used per circle revolution while drawing a</tt> </tt>
<a name="L342"></a><tt class="py-lineno">342</tt>  <tt class="py-line"><tt class="py-docstring">    sphere. The first and second parameters determine the number of segments used    </tt> </tt>
<a name="L343"></a><tt class="py-lineno">343</tt>  <tt class="py-line"><tt class="py-docstring">    longitudinally and latitudinally, respectively. If only one parameter is used, it</tt> </tt>
<a name="L344"></a><tt class="py-lineno">344</tt>  <tt class="py-line"><tt class="py-docstring">    determines the total number of segments used per full circle revolution."""</tt> </tt>
<a name="L345"></a><tt class="py-lineno">345</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">args</tt><tt class="py-op">)</tt><tt class="py-op">==</tt><tt class="py-number">1</tt><tt class="py-op">:</tt> </tt>
<a name="L346"></a><tt class="py-lineno">346</tt>  <tt class="py-line">        <tt id="link-363" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-363', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-364" class="py-name" targets="Variable pyprocessing.globs.shape.sphereDetail=pyprocessing.globs.shape-class.html#sphereDetail,Function pyprocessing.shapes.sphereDetail()=pyprocessing.shapes-module.html#sphereDetail"><a title="pyprocessing.globs.shape.sphereDetail
pyprocessing.shapes.sphereDetail" class="py-name" href="#" onclick="return doclink('link-364', 'sphereDetail', 'link-364');">sphereDetail</a></tt> <tt class="py-op">=</tt> <tt class="py-op">(</tt><tt class="py-name">args</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> <tt class="py-name">args</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L347"></a><tt class="py-lineno">347</tt>  <tt class="py-line">    <tt class="py-keyword">elif</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">args</tt><tt class="py-op">)</tt><tt class="py-op">==</tt><tt class="py-number">2</tt><tt class="py-op">:</tt> </tt>
<a name="L348"></a><tt class="py-lineno">348</tt>  <tt class="py-line">        <tt id="link-365" class="py-name"><a title="pyprocessing.globs.shape" class="py-name" href="#" onclick="return doclink('link-365', 'shape', 'link-6');">shape</a></tt><tt class="py-op">.</tt><tt id="link-366" class="py-name"><a title="pyprocessing.globs.shape.sphereDetail
pyprocessing.shapes.sphereDetail" class="py-name" href="#" onclick="return doclink('link-366', 'sphereDetail', 'link-364');">sphereDetail</a></tt> <tt class="py-op">=</tt> <tt class="py-op">(</tt><tt class="py-name">args</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> <tt class="py-name">args</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
</div><a name="L349"></a><tt class="py-lineno">349</tt>  <tt class="py-line"> </tt><script type="text/javascript">
<!--
expandto(location.href);
// -->
</script>
</pre>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="pyprocessing-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Mon Jun 11 22:06:48 2012
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
